1

getDerivedStateFromProps is static for component. but today I debug the app, I find other components data nextProp.x in getDerivedStateFromProps method when we define it the same.

the other situation is when a component is re-created, the nextProp.x still remains the pre-data.

so when the react-native will remove the getDerivedStateFromProps data, why the data is mixed?

Lenoarod
  • 3,441
  • 14
  • 25

1 Answers1

1

the props is get from parent,if it remians the old data. it can cause by parent. if you use redux,it may be caused by it. the reduce state is not clear.

Dennis
  • 59
  • 7