React Fundamentals

0% completed

Previous
Next
Code Challenge

Challenge 1: Click Counter

Follow these instructions to complete your challenge:

  1. Create a functional component named ClickCounter in the App.jsx file.
  2. Use the useState hook to create a state variable named count, initialized to 0.
  3. Add a button inside the component that, when clicked, increases the count by 1.
  4. Display the current count inside a <p> element.
  5. Render the ClickCounter component inside the App component.

Challenge 2: Show/Hide Texts

Follow these instructions to complete your challenge:

  1. Create a functional component named ToggleText in the App.jsx file.
  2. Use the useState hook to create a state variable isVisible, initialized to true.
  3. Display a paragraph (<p>) with the text "Hello, React!" only if isVisible is true.
  4. Add a button that toggles isVisible between true and false when clicked.
  5. Render the ToggleText component inside the App component.

.....

.....

.....

Like the course? Get enrolled and start learning!
Previous
Next