Skip to content

10-4-pursuit/03-14-usestate-counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

useState Counter

Description

Create a functional component StatefulCounter that uses the useState hook to implement a counter.

Setup

  1. Fork the repository containing this exercise.
  2. Clone your forked repository to your local machine:
    git clone <your-forked-repo-url>
    
  3. Navigate to the project directory:
    cd path/to/repo
    
  4. Create a new React application:
    npx create-react-app .
    

Tasks

  1. In the src folder, create a file StatefulCounter.js.
  2. Define StatefulCounter as a functional component.
  3. Use the useState hook to create a count state variable and a setCount function.
  4. Render a button that, when clicked, increments the count by 1.
  5. Display the current count value on the screen.
  6. Render StatefulCounter in App.js.

Submission

  1. Commit your changes:
    git add .
    git commit -m "Add StatefulCounter component"
    
  2. Push to your fork:
    git push
    
  3. Create a pull request from your fork to the original repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published