-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
refactor(react, react-dom, eslint): rename 'useModernLayoutEffect' to 'useClientLayoutEffect' for clearer semantics #3338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
… 'useClientLayoutEffect' for clearer semantics
✅ Deploy Preview for vibrant-gates-22c214 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Why? |
@floating-ui/core
@floating-ui/dom
@floating-ui/react
@floating-ui/react-dom
@floating-ui/react-native
@floating-ui/utils
@floating-ui/vue
commit: |
The previous name, I believe this change improves readability and maintainability, and aligns more closely with naming conventions in SSR-aware libraries — but of course, open to feedback if there’s a better alternative. |
Ok thanks, makes sense to me. I'll let @atomiks have the last word though. |
The ‘Client’ is redundant since The only reason this util exists is because in React 17 and 18, it warns when The token exists to disambiguate from React’s native A correct name is |
I appreciate the detailed explanation and historical context, especially that this hook exists to avoid warnings in React 17 and 18, and that the name I also understand that since However, I believe that
In conclusion, while “Client” may technically seem redundant, including it might provide greater clarity and maintainability, especially in an open-source environment with contributors of varied experience levels. |
No description provided.