Hacker News new | ask | show | jobs
by psychoslave 1333 days ago
Wait, isn't React a js framework? Is Remix a framework over a framework?
4 comments

If we're calling both "framework" (though as another commenter mentioned, the React package is pretty much just a UI library) then you can think of React as a UI framework and Remix as an application framework. You use the React UI framework in the Remix (or NextJS) application framework.
To be a pedantic shit, I wouldn't say React is a _UI_ library. React's deal at the time of its release was 3 things:

- You can mix js and 'html' in one component

- The unidirectional 'flow' of state

- The internal model / diffing so only components that changed would update the dom

It's a mix of a library (the 'html' elements) and an architecture pattern (unidirectional flow) imo.

I'd expect a UI library to be things like buttons, windows, UI components, etc.

People are using the term “metaframework” these days to describe things like Remix and Next that build on top of React as the view layer and provide many of the other bits you might need to get a fully-fledged web app up and running. Including but not limited to routing, performance optimizations for images and fonts, data fetching, SSR/static generation & regeneration
A meta framework on top of a Meta library?
React is a library. Remix is a framework.
React is a framework though.

The main differentiator between the two is Inversion of Control.

React developers write their code to be called by the React application. You aren't choosing to include React or not (what you would do with a library), your whole frontend application is built within the context of the React environment in which it will run.

Dan Abramov, React lead, says this:

"i like to think of React as two things. React is a library. it is also an architecture (which frameworks may implement)"

https://twitter.com/dan_abramov/status/1585088716443615234

Ember.js, Angular and Vue are frameworks. React is a render library.
If you're only using React then it's just a rendering library running in YOUR application.
> React is a framework though.

framework vs library -- how would you define them?

Your code calls a library; a framework calls your code.
That sounds nice but it’s not that simple. In the case of react you are doing both. You are importing functions like hooks and render. Then you pass render a function that then gets called by react.
It's technically a UI library. Though the line there is fuzzy.