Dan Abramov’s RFC suggests to add a new
useEvent(fn)
hook in React core, without any dependency array. The unstable function/closure passed as a parameter is then stabilized (it keeps the same identity over time). This helps avoid the
stale closure problem (when ESLint rules are not respected) while simplifying optimization via
React.memo()
, and avoiding
useEffects
from re-executing. Changes planned to ESLint rules: the stabilized function does not need to be passed into other dependency arrays, and an “onEvent” / “handleEvent” convention could be adopted.
Next.js will modernize its routing infrastructure. This will help leverage React 18 features, and other upcoming features.
They plan for incremental adoption: the ./pages
folder continues to work as before, and you can gradually move things to a new ./app
folder, which also activates Server Components 🤯.
There will be support for nested routes/layouts based on a layout.js
naming convention. Requests will be executed in parallel (without waterfall). This article is only the 1st part of a huge RFC: the 2nd part is coming.
Extras: