microsoft / griffel

CSS-in-JS with ahead-of-time compilation ⚡️
https://griffel.js.org
MIT License
1.2k stars 61 forks source link

fix: remove eslint exception in `RendererProvider` #566

Closed spmonahan closed 3 months ago

spmonahan commented 5 months ago

Changes the code to strictly follow the Rules of Hooks.

Previously the code conditionally called a hook which prevents React Compiler from making any potential optimizations. Now the conditional has been moved inside the hook.

However, this code is still potentially problematic as we are relying on useMemo() for correctness rather than as a performance optimization:

msedge_dtpiVAZAuS

Depends on #565

github-actions[bot] commented 5 months ago

📊 Bundle size report

✅ No changes found