DEV Community

Discussion on: All you need to know to start writing Svelte Single File Components

Collapse
bdougherty profile image
Brad Dougherty

One small correction: href={href} and href="{href}" both work. They are treated the same way by the Svelte compiler. Using quotes is helpful if you want just one part of the attribute to be dynamic, like href="https://example.com/{path}".

Collapse
danielrios549 profile image
Daniel Rios

Good to know that, the templates strings are good to use inside TS or JS code, but inside HTML I think this way better, almost identical to Python f-string