© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Diego Bernal
Front-End Engineer
Why did you decide to use getDerivedStateFromProps ?
getDerivedStateFromProps
John Doe
Thanks for answer, that's because I had difficulty with my state, the first case, oldState, NewState,oldState, NewState, etc. So that was to control the state rendering.
The use case for that is when your state depends on changing props. Your <App/> component doesn't take any props though.
<App/>
More about getDerivedStateFromProps