If you like my articles, you can buy me a coffee or share it :)
The same component was rendered twice and the button was clicked, the result is as follows.
Output :
Step 2: setIsActive Prop
Let's send the function that updates the state to the child component as a prop.
Output :
Conclusion
The state created within the component is local to the component. In this article, In this article, we examined how Sharing State Between Components. If you want, you can talk about Sharing State Between Components principles in the comments.
SOCIAL SHARE CARD GENERATOR