Today we're sharing that View Transitions and Activity are ready to try in the experimental channel, along with docs and updates on other areas we're actively working on:
react.dev/blog/2025/04...
Today we're sharing that View Transitions and Activity are ready to try in the experimental channel, along with docs and updates on other areas we're actively working on:
react.dev/blog/2025/04...
Today, weβre deprecating Create React App for new apps, and encouraging existing apps to migrate to a framework.
Weβre also providing docs for when a framework isnβt a good fit for your project, or you prefer to start by building a framework.
react.dev/blog/2025/02...
Implemented, evaluated and deleted already
github.com/facebook/rea...
ugh so sorry to hear that :(
Ref Callbacks got an upgrade with React 19, and the presence of the React Compiler has further changed my thinking about using useCallback for those in some situations.
tkdodo.eu/blog/ref-cal...
Thank you @gsathya.bsky.social for starting the discussion about this πββοΈ
new project with React 19
Let's go! π
yeah _pure_ isn't correct, it's more about the captured context -- the compiler moves functions that don't capture any values created in render
cc @ricky.fm
add me!
donβt useEffect, but if you must, donβt call setState in it
I got to speak wearing a traditional Tamil veshti!
so bummed that they've stopped archiving now :(
Don't use memoization for correctness, use it only for perf!
it's too early to share anything concrete as everything could change, but we're thinking deeply about effects!
no you should write it! I always learn something new from your posts
i agree! we're already working on something to make this easier ;)
yes that'd be awesome! :)
Yes exactly!
in the long term, we want to move away from manual memoization in react and would like to remove these APIs
this is why the compiler currently bails out on compiling a component if it's newly compiled memoization is different from the existing manual memoization
so we want folks to just use memo for optimization and then just remove all manual memo after adding the compiler
best case you delete all manual memo and it just works with the compiler because the compiler memoizes everything in the same way
but the compiler could've memoized this callback differently because of heuristics, so it may not be safe to remove this particular useCallback
Imagine you're adopting the compiler and the compiler works great on your app and you ship it. Now you want to delete the useMemo/useCallback from your code to improve dx. How do you know which ones are safe to remove?
you're right that the callback won't be thrown away but using memoization for correctness can cause downstream issues
I'd store the id in a ref and check that manually and not depend on useCallback:
```
const idRef = useRef(null);
const scroller = (node) => {
if (idRef.current === null || idRef.current !== id) {
node?.scrollIntoView({ behavior: "smooth" });
idRef.current = id;
}
};
```
Also I just realized a potential bug in the compiler after reading your post! The compiler will automatically move pure functions outside the component, which can break callback ref identity check
Right, I was referring to the useCallback example (I meant memoization in general, not useMemo)
π Had to post this a lot on the other platform lately and apparently, it blows people's mind that this is possible. I wrote it over 2 years ago, and callback refs will only get better in v19 because they will get cleanup functions. Have a read:
tkdodo.eu/blog/avoidin...
Nice post! One minor nit would be to not use memo for correctness -- you can use a ref to store a boolean and check this boolean before doing the focus instead
This one is special because it's happening at home in Chennai! :)