4 ms·
It is reinventing JSX in that you are really describing components in JSON. And of course you are then feeding back those descriptions into needlessly abstract
by mikojan 2y ago
It is reinventing JSX in that you are really describing components in JSON.
And of course you are then feeding back those descriptions into needlessly abstract JSX but the primal error was not realizing you are describing components in a bespoke manner.
- willio58 2y ago"reinventing" is a strong and less clear word for "over-abstraction" in my book. Nothing was reinvented in this, and the very example the author gave to prove their point could make sense if, for example, you don't know the menu links ahead of time. Like if they are coming from a database table, this would be totally valid. If we do know the menu links ahead of time then there's no point in abstracting it.
- mikojan 2y agoIt is reinventing JSX in the sense that this JSON-based description of the user interface... const menu = [ {_type: "nav_link", to: "/a", displayName: "A"}, {_type: "nav_link", to: "/b", displayName: "B"}, {_type: "download_link", file: "/c.txt", displayName: "Download C"}, ]; ...is the same as this JSX-based description of the user interface... <Menu> <NavLink to="/a">A</NavLink> <NavLink to="/b">B</NavLink> <DownloadLink file="/c.txt">Download C</DownloadLink> </Menu> ...but the first one comes with extra steps and novel markup.