React 19.2 adds "use no memo" directive for debugging

𝗥𝗲𝗮𝗰𝘁 𝟭𝟵.𝟮 𝗷𝘂𝘀𝘁 𝗮𝗱𝗱𝗲𝗱 "𝘂𝘀𝗲 𝗻𝗼 𝗺𝗲𝗺𝗼" 💀 Finally, a directive that tells React: "Hey compiler, I know what I'm doing. Stop helping me." It's like putting "DO NOT OPTIMIZE" on a function. When you'd actually use this: → Never (probably) → Debugging weird performance issues → Your function has side effects React shouldn't cache → You enjoy living dangerously Most devs will never touch this. But knowing it exists? That's the flex. 💪 Anyone else excited about features they'll add "just in case" and never actually use? #React #WebDev #JavaScript #Programming

  • graphical user interface, text, application
Cristian Trifan

Senior React Developer

6mo

"Hey compiler, I know what I'm doing. Stop helping me." That's not the point of the directive. The docs state the purpose clearly: 𝙏𝙝𝙞𝙨 𝙞𝙨 𝙪𝙨𝙚𝙛𝙪𝙡 𝙖𝙨 𝙖 𝙩𝙚𝙢𝙥𝙤𝙧𝙖𝙧𝙮 𝙚𝙨𝙘𝙖𝙥𝙚 𝙝𝙖𝙩𝙘𝙝 𝙬𝙝𝙚𝙣 𝙙𝙚𝙗𝙪𝙜𝙜𝙞𝙣𝙜 𝙤𝙧 𝙬𝙝𝙚𝙣 𝙙𝙚𝙖𝙡𝙞𝙣𝙜 𝙬𝙞𝙩𝙝 𝙘𝙤𝙙𝙚 𝙩𝙝𝙖𝙩 𝙙𝙤𝙚𝙨𝙣’𝙩 𝙬𝙤𝙧𝙠 𝙘𝙤𝙧𝙧𝙚𝙘𝙩𝙡𝙮 𝙬𝙞𝙩𝙝 𝙩𝙝𝙚 𝙘𝙤𝙢𝙥𝙞𝙡𝙚𝙧. Have a full read here https://react.dev/reference/react-compiler/directives/use-no-memo#reference

To view or add a comment, sign in

Explore content categories