-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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] Update Material UI code snippets for React 18 #32361
[docs] Update Material UI code snippets for React 18 #32361
Conversation
@material-ui/core: parsed: +Infinity% , gzip: +Infinity% |
@samuelsycamore instead of changing to |
@siriwatknp For context, the idea of this line was to show that it's all that is needed, there is no provider and other some sort of configuration is needed (We used to require some configuration, I think in v0, developers were complaining about it). |
I appreciate the point made in the intro docs to say "this is everything you need," but it does feel mostly unnecessary otherwise. I would assume that any React dev who's digging around in our docs understands how React components work and doesn't need the rendering line pointed out to them. I'm cool with just removing it entirely. |
@samuelsycamore Agree. Now, this was not the purpose of showing this line of code. The purpose was to demonstrate that I think it's better to keep this line to be very clear, but if you think that it's better without, why not remove it. |
That makes sense. In that case, I'm in favor of removing it. |
docs/data/styles/api/api.md
Outdated
@@ -248,7 +248,7 @@ function App() { | |||
return <StylesProvider jss={jss}>...</StylesProvider>; | |||
} | |||
|
|||
ReactDOM.render(<App />, document.querySelector('#app')); | |||
ReactDOM.createRoot(document.querySelector('#app')).render(<App />); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this page about @mui/styles
? If so then we shouldn't use React 18 APIs since that package isn't compatible with React 18.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @eps1lon!
I found one more occurrence of |
We removed the line but we didn't remove the I'm fixing this in #33122 |
This PR updates all pages in the Material UI docs with code snippets that feature the deprecated way of rendering:
ReactDOM.render(<App />, document.querySelector('#app'));
EDIT: all instances have been removed (rather than being replaced).