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

[docs] Fix warning and crash in dev mode #20623

Merged
merged 1 commit into from
Apr 21, 2020

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Apr 18, 2020

The crash can be reproduced on http://0.0.0.0:3000/components/autocomplete. I have seen warnings on these pages for a few months.

Related to styled-components/styled-components#2998

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Apr 18, 2020
@mui-pr-bot
Copy link

mui-pr-bot commented Apr 18, 2020

No bundle size changes comparing 72a477f...71f9f5e

Generated by 🚫 dangerJS against 71f9f5e

@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged and removed PR: ready to ship labels Apr 20, 2020
@oliviertassinari oliviertassinari added PR: ready to ship and removed PR: out-of-date The pull request has merge conflicts and can't be merged labels Apr 20, 2020
@oliviertassinari oliviertassinari merged commit d35dae4 into mui:master Apr 21, 2020
@oliviertassinari oliviertassinari deleted the docs-fix-pages-with branch April 21, 2020 14:30
@@ -10,6 +10,10 @@ const requireRaw = require.context(
/\.(js|md|tsx)$/,
);

// Run styled-components ref logic
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is "ref logic"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They test that calling useRef crashes, however, we call it inside a React render method, hence, it warns.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it's not about "ref logic" but rather about where we instantiate the module (they could use any hook. useRef is just the fasted). Doing it during render triggers a false alarm in styled-components.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants