One month with React Native
51–55 of 55 posts
Re: One month with React Native
#52Re: One month with React Native
#53> Next, plan your Redux store ahead. I feel like I made the mistake of overusing it. Almost every property of my app is managed by Redux and this results in large reducers and many many actions to control all that. It’s very important to figure if some prop will be needed outside a certain component or not and, if not, keep that inside that component. How can you possibly know _in advance_ if a prop will be needed ou…
Redux has a great piece of their tutorial that deals with this problem: http://redux.js.org/docs/recipes/reducers/BasicReducerStruct... . Here are a few gotchas to avoid: 1. Define your state shape in terms of your domain data and app state, not your UI component tree. 2. Your reducers do not need to have a 1 to 1 mapping to actions. If you need to fire multiple actions to change the data you need then rethink your r…
I'm not sure that's what OP is recommending though? In fact, that redux doc seems to me to making an opposite suggestion to the OP -- it seems to be suggesting you should put domain data, app state, and UI state all in the store, but "define your state shape in terms of your domain data and app state, not your UI component tree." OP seems to recommend trying ot keep app state and UI state _out_ of the store if you can.
I think people in practice have a lot of trouble with this, and making it successful, even after experience.
But apparently a lot don't too?
Re: One month with React Native
#54> Next, plan your Redux store ahead. I feel like I made the mistake of overusing it. Almost every property of my app is managed by Redux and this results in large reducers and many many actions to control all that. It’s very important to figure if some prop will be needed outside a certain component or not and, if not, keep that inside that component. How can you possibly know _in advance_ if a prop will be needed ou…
You can make that effort of thinking the component architecture ahead and that will definitely help. To be honest I was thinking more about props that you'll know will live inside a component but end up on the redux store anyway. I made this mistake with forms on my first react native app by having any field value on the store. I didn't really need to that and the store got bigger and bigger because of that first cho…
Re: One month with React Native
#55I'm going through a similar experience. I have some experience with Objective C and iOS, almost nothing with Android and I have good experience with (non-mobile) Java. Basically I have a week to build Android app which should be quickly ported to iOS. So far my experience is mixed. React Native feels like very powerful tech. But standard library is very minimal, tooling looks very fragile (it works, but I'm very afra…
Navigation is indeed a hairy beast right now. We're working hard to get React-navigation in shape for 1.0. I think the solutions from Wix and Airbnb are fantastic -- but the community deserves a really polished, JS-only solution that's ready for production. I hope you take another look at React-Nav when we release 1.0! Disclaimer: I work on React Native, react-navigation, etc @ Expo (expo.io)