Mapping components
✓ Published0🌍 Public
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
MIT Licensed