You need to install React to be able to run this application: 'npm i create-react-app'
A simple counter application that uses this.setState
and this.state
to update and capture the state of a displayed counter each time that a button is clicked. For example, if the "+" button is clicked, the displayed counter will increment by 1. If the "-" button is clicked, the counter will decrement by 1.
Create the following components, all within your app.js
file.
- Should contain your
<Counter>
component and should be wrapped in<React.Fragment>
. The component heirarchy should looks as follows:
<App>
<Counter>
- Should contain the following state:
this.state = {
count: 0,
};
- Should contain a
<p>
element that contains the current number of clicks against your counter. On initialization, it should start with/display "0". - Should contain a button that displays a "+" for incrementing the counter. On click, the
count
property on your state should update/increment by 1 and the<p>
element referenced above should display the result. - Should contain a button that displays a "-" for decrementing the counter. On click, the
count
property on your state should update/decrement by 1 and the<p>
element referenced above should display the result.
###Time Estimate Number and name of feature: Simple Counter
Estimate of time needed to complete: 2 hours
Start time: 08:55 AM
Finish time: 09:40 AM
Actual time needed to complete: 45 minutes
lab-11-counter's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.