Challenge: Favorite Fruit Selector
Follow these instructions to complete your challenge:
- Create a functional component named
FruitSelector
in the App.jsx
file.
- Inside this component, create an array of fruit names (e.g., "Apple", "Banana", "Orange", "Mango").
- Display a list of buttons, each representing a fruit.
- When a button is clicked, update a state variable to show which fruit was selected.
- Display the selected fruit in a
<p>
tag.
Expected Output: