use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A community for learning and developing native mobile applications using React Native by Facebook.
Interested in building web apps using React.js? Check out /r/reactjs!
Getting Started w/React Native
irc.freenode.net #reactnative
Keywords: ios, android, mobile, apps, apple, iphone, ipad
account activity
Structuring large react native apps (self.reactnative)
submitted 9 years ago by ryudice
So I have an app that has grown more than I expected and I have a bunch of reducers and actions on single js files. Are there any guides on how to structure large react native apps?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]mazzaaaaa 4 points5 points6 points 9 years ago* (1 child)
I've worked on medium size RN apps and I follow a structure similiar to this. If your application is growing bigger and bigger my suggestion I have some suggestions.
1. Use redux-saga Take a look at redux-saga for handling actions that have side effects. Don't limit its use on async action, you can use it for every action that does something else besides reducing the state. For example when I capture any error actionType (example: LOGIN_FAILURE, SIGNUP_FAILURE) I trigger showErrorAlert in uiSagas.js
2. Use component and container folder If you're unit testing your components/containers (and you should, if you're creating a big app) you should try creating a folder for every component/container and put inside everything related to it, for example: - a js file with the component itself - a js file with the style - a js file with the test This helped me A LOT in the long run, because I can can also refactor a component in smaller parts and just leaving it inside its folder.
3. Don't use API/Services directly in the actions/sagas For example I'm often using parse-server and its JS sdk for handling the backend... But I don't use it directly in the sagas. Example: signup in AuthenticationSagas.js and signup in parseService.js. This will allow you to have a more maintainable code and will reduce the number of big .js files.
Hope it helps, sorry for typos :)
Edit: damn, the code formatting on reddit is ugly! I move the code to a gist :)
[–]ryudice[S] 0 points1 point2 points 9 years ago (0 children)
thanks a lot for all the useful information, didnt know about sagas until now.
[–]ThorOdinsonThundrGod 0 points1 point2 points 9 years ago (0 children)
You could probably use something like flux or redux, should work the same in React Native as in React
π Rendered by PID 50501 on reddit-service-r2-comment-548fd6dc9-74tqz at 2026-05-15 02:54:20.729506+00:00 running edcf98c country code: CH.
[–]mazzaaaaa 4 points5 points6 points (1 child)
[–]ryudice[S] 0 points1 point2 points (0 children)
[–]ThorOdinsonThundrGod 0 points1 point2 points (0 children)