Oct '24 • Help
React Challenge 4 Thoughts
So I'm really getting hung up and I think mixing concepts between functional and class components. So in my app, it now seems to me that we'd need a fourth component being the button.
Because state is supposed to be in App only, but I need to pass the props of the onClick event listener so that each counter has its own button that will update the state of the counterValues.
I keep getting undefined or it just doesn't exist when I try to pass the onClick event as a prop down the component heiarchy, and I'm not sure how to fix that other than creating another component (not quite sure where to go from there, but the React docs showed me an example of using a Button component to pass an eventListener as a prop), maybe I'm trying to do too much?
2
12 comments
Trey Delcamp
6
React Challenge 4 Thoughts
Developer Pro
skool.com/developerpro
Learn how to code. Make money. Have fun. Enjoy life.
Leaderboard (30-day)
Powered by