Thus far, in all these examples, the content that was returned was static. It was content like <p>Hello World!</p>
—which of course is content that never changes. It will always output a paragraph that says, 'Hello World!'
.
But most websites, of course, need to output dynamic content that may change (e.g., due to user input). Similarly, you’ll have a hard time finding lots of websites without any images.
Thus, as a React developer, it’s important to know how to output dynamic content (and what “dynamic content” actually means) and how to display images in a React app.
Outputting Dynamic Content
At this point in the book, you don’t yet have any tools to make the content more dynamic. To be precise, React requires that state concept (which will be covered in Chapter 4, Working with Events and State) to change the content that is displayed (e.g., upon user input or some other event...