正在加载视频...

视频加载失败

❌ useMemo, useCallback, memo everywhere ✅ React Compiler handles it automatically React Compiler v1.0 is here. It analyzes your code at build time and adds memoization where needed.↓

63,113 次观看 • 9 个月前 •via X (Twitter)

28 条评论

Rahul Rana 的头像
Rahul Rana9 个月前

Here we go as you promised 🙂 React compiler simplifies un-necessary optimization. Really curious to know how it internally manages this things.

George Moller 的头像
George Moller9 个月前

you got it!

Catalin 的头像
Catalin9 个月前

finally. been waiting for this since the 2024 beta. does it play nice with bun builds or still babel only?

George Moller 的头像
George Moller9 个月前

no native support for bun build yet, there is an open issue asking exactly that here:

Catalin 的头像
Catalin9 个月前

appreciate it. fwiw the workaround rn is running babel-plugin-react-compiler separately before bun build but it's janky. native support would be clean

Den 的头像
Den9 个月前

Finally. Let the compiler handle it 👌

George Moller 的头像
George Moller9 个月前

Been waiting for this feature! Have you tried it?

Alexey Lyakhov 的头像
Alexey Lyakhov9 个月前

They should remove useEffect too

George Moller 的头像
George Moller9 个月前

🤣

Alexey Lyakhov 的头像
Alexey Lyakhov9 个月前

They should remove this hooks from react. I will make eslint-plugin-react-dehookify

George Moller 的头像
George Moller9 个月前

pleas do, and share it here!

Alexey Lyakhov 的头像
Alexey Lyakhov9 个月前

Published my new package enjoy

Alexander 的头像
Alexander9 个月前

unfortunately, AI often adds unnecessary with React Compiler optimizations

Claudiu 的头像
Claudiu9 个月前

This is huge! There were people not using useMemo and useCallback hooks, and people abusing them (guilty of this sometimes 😁). This settles the debate once and for all 😀.

George Moller 的头像
George Moller9 个月前

Pretty much yes!

Gregor 的头像
Gregor9 个月前

Building my finance app, I've noticed that manual memoization can be tedious and error-prone. Sometimes I've added it where it wasn't needed, which just added complexity. React Compiler's automated approach sounds like a huge relief.

Vencedor Zest 的头像
Vencedor Zest9 个月前

Curious about how it works internally

Christian 的头像
Christian9 个月前

Is it plug-and-play with any react setup?

George Moller 的头像
George Moller9 个月前

you just need to add the babel plugin to whatever build tool you are using: babel-plugin-react-compiler@latest

Pola 的头像
Pola9 个月前

@javascramble Babel in 2026, dear lord…

George Moller 的头像
George Moller9 个月前

@javascramble lol

Alexey Lyakhov 的头像
Alexey Lyakhov9 个月前

Created new eslint plugin for those who use react-compiler in existing projects

Iqboljon Hasan 的头像
Iqboljon Hasan9 个月前

react created rendering issues, and now kinda solving them

Chris 的头像
Chris9 个月前

What happens to my production code with useMemo & useCallback?

George Moller 的头像
George Moller9 个月前

what version of react do you have?

Chris 的头像
Chris9 个月前

It’s an older version and I haven’t updated to the latest. I’m curious to know what happens if I update. Should I remove the useMemo and useCallback?

Chris 的头像
Chris9 个月前

@autistikatronik @_georgemoller Got it 🫡

0xd3112 的头像
0xd31129 个月前

Im skeptical. Is it better than a junior dev that just learned about those? If you use a usecallback and ask cursor to add some code everything becomes usecallback 😂

相关视频