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] Enable StrictMode #22981

Closed
wants to merge 1 commit into from

Conversation

oliviertassinari
Copy link
Member

I'm not eager to see other occurrences of mui/mui-x#177 going forward. I couldn't notice any errors in development. I could test that the switch work with:

diff --git a/docs/src/pages/components/alert/BasicAlerts.tsx b/docs/src/pages/components/alert/BasicAlerts.tsx
index b0525db44c..bd9b09e0d8 100644
--- a/docs/src/pages/components/alert/BasicAlerts.tsx
+++ b/docs/src/pages/components/alert/BasicAlerts.tsx
@@ -1,4 +1,5 @@
 import * as React from 'react';
+import ReactDOM from 'react-dom';
 import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
 import Alert from '@material-ui/core/Alert';

@@ -13,12 +14,23 @@ const useStyles = makeStyles((theme: Theme) =>
   }),
 );

+class Foo extends React.Component {
+  render() {
+    return <div>hello</div>
+  }
+}
+
 export default function BasicAlerts() {
   const classes = useStyles();
+  const ref = React.useRef();
+
+  React.useEffect(() => {
+    ReactDOM.findDOMNode(ref.current);
+  });

   return (
     <div className={classes.root}>
-      <Alert severity="error">This is an error alert — check it out!</Alert>
+      <Foo ref={ref} severity="error">This is an error alert — check it out!</Foo>
       <Alert severity="warning">This is a warning alert — check it out!</Alert>
       <Alert severity="info">This is an info alert — check it out!</Alert>
       <Alert severity="success">This is a success alert — check it out!</Alert>

Capture d’écran 2020-10-11 à 17 47 52

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

Details of bundle changes

Generated by 🚫 dangerJS against ffa8b4f

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

As long as we use @material-ui/styles we can't use StrictMode.

Try navigating pages with yarn docs:dev. Styles should be broken.

If you find a bug then you should write an automated test. Manual testing does not scale with our team size.

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Oct 11, 2020

I couldn't spot any bugs navigating the pages. I believe the bugs we have are related to the usage of dynamic props #18018, which we barely use and are progressively moving to emotion. I also recall one around global class name styles that aren't removed, however, the global styles we have are meant to be generic (they don't cause any visual issue I could spot).

@eps1lon
Copy link
Member

eps1lon commented Oct 11, 2020

I believe the bugs we have are related to the usage of dynamic props #18018, which we barely use and are progressively moving to emotion

But we still do and as long as these remains we can't switch. It would make local development just annoying.

@oliviertassinari
Copy link
Member Author

Ok, for later then. I will enable it on material-ui-x to see how that goes.

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Oct 11, 2020

Well no, I can't do that on material-ui-x, it's broken with the v4 documentation 😆, can only on next.

Capture d’écran 2020-10-11 à 19 33 47

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