Skip to content
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

[core] Add a comment to explain useEnhancedEffect #39035

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Sep 18, 2023

See mui/toolpad#2671 (comment)

also, consider renaming this hook to something more descriptive. e.g. I've seen other libraries use useIsomorphicLayoutEffect.

@Janpot Janpot added the docs Improvements or additions to the documentation label Sep 18, 2023
@mui-bot
Copy link

mui-bot commented Sep 18, 2023

Netlify deploy preview

https://deploy-preview-39035--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 7f7b2b9

@Janpot Janpot marked this pull request as ready for review September 18, 2023 09:35
@danilo-leal danilo-leal changed the title Add a comment to explain useEnhancedEffect [docs] Add a comment to explain useEnhancedEffect Sep 18, 2023
@mnajdova mnajdova changed the title [docs] Add a comment to explain useEnhancedEffect [core] Add a comment to explain useEnhancedEffect Sep 18, 2023
@Janpot Janpot merged commit 567b8cb into mui:master Sep 18, 2023
7 checks passed
@danilo-leal danilo-leal added core Infrastructure work going on behind the scenes and removed docs Improvements or additions to the documentation labels Sep 18, 2023
@oliviertassinari
Copy link
Member

oliviertassinari commented Sep 18, 2023

It's being redefined in some of the docs examples, e.g.

. Perhaps this should also import the @mui/utils one? (The usage here seems a bit funky as well)

@Janpot @mui/utils is private today, we can't use it in the demos: https://www.notion.so/mui-org/mui-utils-purpose-9a9fc9da3a004864b6c4e1f4d1f24f95.

also, consider renaming this hook to something more descriptive. e.g. I've seen other libraries use useIsomorphicLayoutEffect.

This makes sense to me though not easy to change. To keep in sync with

'react-hooks/exhaustive-deps': ['error', { additionalHooks: 'useEnhancedEffect' }],

danilo-leal pushed a commit to siriwatknp/material-ui that referenced this pull request Sep 18, 2023
@Janpot Janpot deleted the useEnhancedEffect-comment branch September 19, 2023 05:05
christophermorin pushed a commit to christophermorin/material-ui that referenced this pull request Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants