Загрузка видео...

Не удалось загрузить видео

На главную

❌ 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 😂

Похожие видео