Updating React State Based on Props
In React, the props are immutable (i.e., read-only) data that is passed from the parent component to its child component. Therefore, it is not recommended to update the state directly from props. However, you can use the props to update the state by ...
asritha.hashnode.dev2 min read