5 ms·
I was surprised to see that this uses React without Redux for state management. I'm aware that Redux is a separate, optional, codebase, but from how people have
by jeeeeefff 8y ago
I was surprised to see that this uses React without Redux for state management. I'm aware that Redux is a separate, optional, codebase, but from how people have been talking, it seemed like just about everyone was Redux or bust.
How many production-scale projects don't use Redux? Is this more common than I'm thinking and hearing?
- x4nt 8y agoWorking on a new production app right now that does not use Redux, I do not plan on backwards integration either. For reference, our team does have two applications that utilize Redux.
- ramigb 8y agohttps://www.quora.com/Can-you-build-a-complete-react-application-without-redux https://www.quora.com/Can-you-build-a-complete-react-applica...
- Ilikeruby 8y agoI personally used redux one time on a project and said, never again.
- robertAngst 8y agoI wish, but I think my project is too big for me to avoid it.
- andrewingram 8y agoEvery app i've worked on for the last 3 years has fit in one of two categories: 1. Minimal use of Redux 2. Started with Redux, migrating to eliminating Redux. This has mainly been due to using other technologies for dealing with API data (i'm using Relay, but there are other options), and having relatively little need for client-side state that can't be handled at the component level. When I have needed simple shared state, I just use the context API. If I absolutely needed a lot of client-side shared state, I might still consider Redux, but would also strongly consider client-side GraphQL extensions (both Relay and Apollo support these) so that everything follows the same patterns.
- kbcool 8y agoIs Apollo ready for true client side caching these days? I tried it on an app earlier this year with the belief that it would allow me to skip redux and simply keep client state synchronised with the server but without having to load it every time and walked away disappointed. The vision is great though!
- andrewingram 8y agoAs far as Apollo Client is concerned, I don't really know. I keep up-to-date with what's going on, but haven't really used it. Everything i've heard suggests there shouldn't be a problem, but Apollo is really good at marketing. For Relay you're basically given no caching out of the box, but you can implement it by essentially hijacking the store's garbage collection to use an LRU cache instead of immediately evicting data when its dependents unmount. The developer experience for client-side schema extensions is similarly immature, but it is possible. If you need all this functionality and aren't comfortable diving into the trenches, you'll have an easier time with Apollo (assuming everything works as advertised).
- chrisco255 8y agoWhat were your negative experiences with Apollo? Been using it for a year and haven't had any issues.
- 8y ago
- kbcool 8y agoI wouldn't get too excited. This is just a shell app, a few screens, no remote data, only temporal state persistence and nothing really functions (eg no form validation, no payments etc). I assume it was used for some tutorial?! Not saying you can't get away with not using redux at all but this isn't an example of that. Try mobx or unstated for simple state management. Personally my projects tend to use it because I'm used to it. Once you get your head around it the boilerplate is not too much to deal with and it slides in so nicely with react. You just need to think in a functional way. Also features like redux-persist make it powerful. You wouldn't believe the number of apps released on the stores using RN that don't persist state and simply restart when the phone runs out of memory or gets rebooted.
- robertAngst 8y agoHeh, when I saw UI, I was thinking- So what? Javascript, RN, flux, elements, etc... there are soo many ways to make it pretty. That was the whole point. Pretty for android and ios. The redux tutorial is awful, you dont run the program until the very end. Needless to say, it didnt work and I ended up following a medium guide... Now I'm trying to get redux working with laravel who requires a CSRF token on each post request. Not a big deal, but getting this CSRF token to be submitted doesnt seem to be trivial since it needs to be requested from the php and submitted all at once. Not complaining because this is just logic and the job, but the difference between a working RN app and a working RN UI is 10 months.
- wolco 8y agoUse jwt instead and treat laravel as a pure api backend.
- chrisco255 8y agoNot sure what Redux would have to do with a CSRF token? That's HTTP logic.
- sodafountan 8y agoYou can absolutely build React apps without Redux, often times however I find myself using Redux the most while communicating with the Api (Call out to the API, get some new data, put it into the Redux store, App rerenders) so if this is just a shell, then I'm assuming it would be fairly easy to get away with not using it.
- rhapsodyv 8y agoWe don't use redux. We are happy using js-data with a rest backend right now. We going to try graph-ql soon.
- anderskev 8y agoWe have three RN production apps, only one is using Redux because the developer was familiar with it, not because we necessarily needed it. The other two are using Apollo Link for client-side state.