No, we can’t change the state of the component directly. State can only be changed by using setState()
method. Changing the state variable directly won’t re-render the component.
Search
Aug 17, 2024, 1 min read
No, we can’t change the state of the component directly. State can only be changed by using setState()
method. Changing the state variable directly won’t re-render the component.