Tagged Templates Playground

The library's reminder letters: a tag function gets the string pieces and the values apart, from a template that really runs. The base of safe sql`` and…

Why it matters

Tagged templates are the engine behind styled-components, gql, and safe html/sql tags. Because a tag sees dynamic values apart from static text, it can escape or parse only the parts that need it.

The key idea

A tag is just a function; the template is cut into static pieces and values

Try it in this playground