I've wrote a short article about handling inner React state from outside with coroutines: https://medium.com/@altavir/taming-react-with-kotlin-js-and-coroutines-ef0d3f72b3ea. Several people asked me why not use redux. In my particular case it won't work but wanted to ask the backward question (just for understanding it better): does redux do something that is not possible with channel?
👍 3
v
vlad.minaev
09/30/2019, 2:30 PM
Hi, thanks for sharing your approach!
vlad.minaev
09/30/2019, 2:31 PM
However, it looks a little bit non-react way, as state is supposed to be used only to keep internal changes
vlad.minaev
09/30/2019, 2:34 PM
I'm not sure why you need to propagate changes to state if it's possible to pass them as props
vlad.minaev
09/30/2019, 3:08 PM
Maybe I'm missing something
a
altavir
09/30/2019, 3:22 PM
Well, we had a long discussion with the people, who are using react (in russian telegram chat), they also said that the solution is not quite rect-ish. Still, it has one important feature, the inner state is recreated each time new render with propertiese is done, so it you want to control only small aspect of your compoment and leave everething else unchanged, you can't do it by passing new parameters. I think that it could be done more reactish by storing state externally, modifying it from the channel and redrawing component on each