Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Relay already is a replacement for Redux. It wraps React components and it has a store

That's hardly the definition of a replacement for Redux.

Relay v1 has absolutely no client-side state management support. I'm sorry but it's incredibly disingenuous to say they're substitutes at this point. Apparently v2 will have some client-side support.

To be clear, I don't want to bash Relay. I really like GraphQL and have Relay to thank for helping me to get stated on it. I've just found it to have a lot of challenging complexity which is really hard to manage, especially compared to Apollo. Also, "replacing Redux" is really not a selling point. The Redux ecosystem is strong enough at this point that being able to work with it is a huge advantage.

> How could you even use Relay and Redux together?

Pretty easily. The nice thing about the React ecosystem is that things rarely conflict with each other. In my case, API data is updated/fetched via Relay while purely client-side info uses Redux.



I suppose you have a class of data that is not trivial enough to store in a single component's state, but also not worth sending to the server. Personally, I'm happy to be rid of having to maintain this kind of state if I can.


> I suppose you have a class of data that is not trivial enough to store in a single component's state, but also not worth sending to the server.

Exactly. For example, one application I'm working on has a complicated multi-page form/wizard. Redux is great for keeping this manageable and in fact takes care of all the management for this without me also having to write code for managing it on the backend at all.


You mean Redux, right?


Yup! Edited.


Interesting. Till now I only used redux to store server-side info. Client-side stuff always went into the component state.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: