4 ms·
One of the things that I don't like about React applies to maybe all frameworks. It's easy to get 90% of the way there, but the last 10% is the hardest. For exa
by cdelsolar 6y ago
One of the things that I don't like about React applies to maybe all frameworks. It's easy to get 90% of the way there, but the last 10% is the hardest. For example, I'm building a real-time websocket app with React. Everything seems pretty easy to build, I'm using hooks, React Router, etc. But coordinating socket connections / reconnections / etc and fitting it into a very functional paradigm is just very very difficult, much more than it would be in a more straightforward library.
- crooked-v 6y agoFor that kind of thing, rather than tightly coupling it to your React tree, you should have components that sanely handle each possible state (no connection, connected but no data yet, new data available, stale cached data available, etc), then have separate handling for the socket stuff that updates data via a global store like Redux.