This just in, a new business requirement! Add users name entered from another component. And based on their role, they increment by 2.
Your setup is cleaner though!
Add the user state to a common ancestor. Pass the user object down as props.
State management is by far the hardest part of frontend development. But react offers some if the best tools out there.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This just in, a new business requirement! Add users name entered from another component. And based on their role, they increment by 2.
Your setup is cleaner though!
Add the user state to a common ancestor. Pass the user object down as props.
State management is by far the hardest part of frontend development. But react offers some if the best tools out there.