3 ms·
This is not serious, right? It's a no-framework framework (what?) to build purely-functional UIs using pure-ish (what?) components. The "why" section doesn't an
by iakov 3y ago
This is not serious, right? It's a no-framework framework (what?) to build purely-functional UIs using pure-ish (what?) components. The "why" section doesn't answer the question of "why" though - it briefly mentions Redux and useState limitations without explaining how this is going to be a better solution.
Really, how is this different from a top-level useState call, that then gets passed down via props drilldown to children components? The repo mentions that the "heart" is not a code but a convention, but you can do the same convention in React. In fact I believe you can do much better with context - prop drilldown absolutely sucks when the complexity of your component tree grows.
Am I missing something?
- boris_m 3y agoYes, you can use the same convention in React (or rather use React with the same convention), this is mentioned in the description actually. As far as "prop drilling" goes, I never understood what is the problem that some people have with it. If you just put your state in one object its just one more param that you have to pass to components. Do we really need a big-ass framework just because of one extra param. Also, by passing state explicitly, you get a clear visibility over which component needs what. And it also allows you to restrict which component uses which parts of the state.
- iakov 3y agoIf this convention can be used in React, what is the "no-framework framework"? What's the point? React is not "just one extra param". One thing it does and your "no-framework framework" does not is figuring out what needs to be updated when the state changes. Add some console.log statements to your components and you'll see that clicking on any button on the demo page results in all components being updated, causing update of DOM nodes. How can this possible work in a complex web page? I click on the "Close Modal" button, and every single DOM node on the page gets updated, from the menu bar down to each and every button? That's the very basic thing that React does. I am not talking about anything else, like component lifecycle or hooks. This not-framework doesn't even begin to approach what React does. If you don't want the "big-ass framework" for whatever reason, there are Inferno and Preact already. Both are great projects and have all the things a developer expects from React replacement.
- naasking 3y ago> If this convention can be used in React, what is the "no-framework framework"? What's the point? I think the point is a "no-state handling framework". It seems like you can combine this with something like morphdom to get React-like merging for pure DOM updates, and the state-handling is via this hierarchical approach. Or your DOM construction can be via a vDOM library which then handles the merges for you.
- thomasfromcdnjs 3y agoBaha I had the same what moments.
- earthboundkid 3y agoI also used the phrase "not serious" on Lobsters. Sorry to the author, but this doesn't meet the bar to talk about outside of a small Mastodon circle. It's just a half-baked idea. It's cool and everything has to start somewhere, but come back to us when you've actually figured something out and made something really fleshed out.