DEV Community

John Peters
John Peters

Posted on

React : The Redux/Flux Scofflaw

It was at first, an opinion I had. The Redux/Flux design pattern was ugly. Slightly difficult to understand, but more than that; the reason for adopting it never made sense to me. It was
over-engineering in my mind. A solution looking for a problem. An unshakable friend I didn't like. It was ugly to me.

It violated the single responsibility pattern by misappropriation. The state responsibility being wholly owned by any component, and not the component middleware. Initial state and subsequent progression had; for 25+ years, been within the component itself implemented via only events and event handlers.

If that architecture needed improvement, certainly browsers would have picked it up first; however, they didn't. There was no reason to change.

When hooks arrived to the React platform it was a subtle admission to a prior mistake. At last, each component was fully responsible for its own state.

Unfortunately, the legacy lives on; because traditions are hard to break. The only thing harder is convincing architects their Flux stance is now legacy.

This includes NPX.

Discussion (0)