Before we had one hierarchy where everything was a component, logic and visuals.
Now we have two hierarchies where visuals are components and logic are hooks.
One one hand, staying within the world of React components gives you a lot of functionality for free. And with Suspense and Hooks, the amount you can do within a component has become even greater.
On the other hand, there are still things that you can't do within a component. For example, you can't easily run an async function once when the component mounts - which in my opinion, would be the perfect way to fetch data.
I've been building Navi to try and create a more natural way to map routes to views and a stream of data. The thing is, the more edge cases you cover, the closer it becomes to just building React from scratch.
At this point I still think that routing and data fetching is better handled externally from React, but it's less clear cut than it used to be.
- has an easy <Router onChange={...}> callback
- instead of <Link to> you can just use <a href> and it works for internal and external links
- routes are per default "exact", so "/profile" doesn't match "/profile/settings"
So much better, highly recommended. You probably need to alias "preact" to "react" in your webpack settings though.