2.5: interpolation
Good React developers are all about writing streamlined code. There is a tendency to do all JSX(HTML), CSS, and JavaScript in the same file. Being streamlined using arrow functions is common, and knowing string interpolation is important as well, especially when writing JSX code. Let's just review a little before forging ahead.
Tools needed for the job:
`
$
{yourvariable}
Here are some examples:
Here's another examle. This is called a template literals - which breaks things into more than one line, and it's handy with HTML.
It's very common to see interpolation with an object in React. Check it out:
Get some practice with interpolation. You will see it a lot in weeks to come.
Last updated