🌍 Public
Viewing a saved revision (read-only)
9e0e12a25e9b4929a6f0d51bd054a5e4
Mapping components
This example shows how to render a list of jokes from an array of objects using React components. The `App` component maps over the imported `JokeSource` array and passes each item’s `question` and `punchline` as props to the `Joke` component, which conditionally displays the question and adjusts the punchline font size based on whether a question exists. The code uses React’s `map()` method to generate multiple DOM elements dynamically from the static data file.
AI-generated descriptionIn this exercise, I will take an array of raw data and convert them into a number of components.
Use imported array of objects to make a list of jokes