Global state in React Native

前端 未结 6 1695
自闭症患者
自闭症患者 2020-12-06 10:03

I am developing a React Native application.

I want to save the user id of the person who is logged in and then check if the user is logged in in every single compone

6条回答
  •  遥遥无期
    2020-12-06 10:45

    There are some alternatives to Redux in terms of state management. I would recommend you to look at Jumpsuit and Mobx. However do not expect them to be easier than Redux. State management is mostly a magical thing and most of the gizmo happens behind the scenes.

    But anyways if you feel that you need some global state management, it worths your time to master one of the solutions no matter Redux or Mobx or etc. I would not recommend using AsyncStorage or anything hacky for this purpose.

提交回复
热议问题