Andrey (azangru) wrote,
Andrey
azangru

Tagged template literals!

They have been around for several years, yet I’ve never had an occasion to actually use them, and thus had no idea what that syntax meant. Apparently they are pretty mainstream in certain communities (e.g. ones that use graphql or styled components).

Example from Relay:

Relay.QL`
  fragment on Greetings {
    hello,
  }
`;


Example from styled components:

styled.h1`
  font-size: 1.5em;
  text-align: center;
  color: palevioletred;
`;


Article on MDN.io
Subscribe

  • (no subject)

    Today I learned that the word maidan exists in English, and that it is of Arabic origin. I've never heard it other than in the Ukranian context of…

  • (no subject)

    A short report by Leonid Rogozov about how he operated on himself to remove his own appendix in Antarctica. Published in English in the Soviet…

  • (no subject)

    Great opening paragraphs by Chris. The first one captures what I've been feeling about the subject, but haven't found the words to express it so…

  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments