Question: 1 . Create a class component called MyCounter.js that depends on another class component, CounterDisplayer.js . MyCounter.js keeps track of the click
Create a class component called "MyCounter.js that depends on another
class component, "CounterDisplayer.js "MyCounter.js keeps track of the
click count value in the state, and this is where you initialize your state,
which holds the click counts.
Create a function named "allClicksCounter in "MyCounter.js that will
update or increase your state by one anytime the button in the
"MyCounter.js component is clicked.
Hint:
The primary function of "CounterDisplayer.js is to show how many
times the button in the "MyCounter.js component has been clicked.
That is you need to use props to pass the updated click data from
"MyCounter.js to "CounterDisplayer.js
Display the number of clicks exactly below the button.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
