Possible navigation issue in React Native/Redux app

后端 未结 5 1560
情话喂你
情话喂你 2021-02-03 13:01

During navigation in big React Native app with using Redux all visited scenes (scenes from navigation stack) are staying mounted. All these scenes receive props and get rendered

5条回答
  •  清酒与你
    2021-02-03 13:32

    I'm going to go out on a limb here but are you using one of the below methods to prevent re-rendering?

    • PureComponents (added in React 15.3 I think)
    • Manually with shallow compare props and state with shouldComponentUpdate method.

    By default React will re-render all components upon update unless you correctly handle the shouldComponentUpdate.

    I'm doing something similar and not having these issues at all

提交回复
热议问题