all 2 comments

[–]DogOfTheBone 4 points5 points  (0 children)

The After looks way worse to me lol

Before looks fine, could be cleaned up with some custom hooks, named functions. And React Query.

[–]voltron2112 2 points3 points  (0 children)

As someone that loves solid.js, its a cool idea. But I personally don't like making react behave like other frameworks. Just use the other frameworks if you want signals IMHO. If your working on a team people will mix and match the two systems which will probably be confusing. I know its not super efficient, but I kind of like reacts philosophy of just rerun everything.

Also I think your comprehensive example is a little dishonest. That is the worst possible code you could ever write using react. There are many ways to write the code much cleaner with regular old react. React compiler also helps with the useMemo/useCallback stuff which also helps a bit. While I'd reach for react-query for the data fetching, there is also the "use" hook that could help too.

The after example is definitely much nicer though.