问题
I worked with ReactJS and flux. They are to used to build web based applications. And flux is used to enhance the way to data flow providing bidirectional data flow.
I start learning react native and wants to know
─ Can I use flux into react-native ?
OR
─ Is there any other libraries or framework available to use in react native. I came across Redux. Is that only option in react native ?
Please help me to clarify what to use in react native.
回答1:
Yes, you can use Flux in your react native app, but Redux will fit anyway the 99,9% of your cases. Redux is not the only option but is the most used in production so you'll find a lot of examples, not mentioning it is a Flux semplification so if you've worked with Flux maybe you'll get ready very early with Redux. If persistency is not an issue with your app you can just rely on local state patterns.
React Native + Redux: https://blog.cloudboost.io/getting-started-with-react-native-and-redux-6cd4addeb29
React Native + Flux: https://medium.com/react-native-development/writing-a-react-native-tutorial-in-an-age-of-flux-55fb62d5ff7a
来源:https://stackoverflow.com/questions/52816898/react-native-bidirectional-data-flow