-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I suspect an issue in React itself. It was working a year ago.
- Loading branch information
1 parent
6ab45d2
commit 7115cc2
Showing
6 changed files
with
84 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,18 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { withStyles } from '@material-ui/core/styles'; | ||
import NoSsr from '@material-ui/core/NoSsr'; | ||
import Button from '@material-ui/core/Button'; | ||
|
||
const styles = theme => ({ | ||
button: { | ||
display: 'block', | ||
margin: theme.spacing(2), | ||
}, | ||
}); | ||
|
||
function SimpleNoSsr(props) { | ||
const { classes } = props; | ||
import Box from '@material-ui/core/Box'; | ||
|
||
export default function SimpleNoSsr() { | ||
return ( | ||
<div> | ||
<Button className={classes.button} variant="contained" color="primary"> | ||
Server & Client | ||
</Button> | ||
<Box p={2} bgcolor="primary.main" color="primary.contrastText"> | ||
Server and Client | ||
</Box> | ||
<NoSsr> | ||
<Button className={classes.button} variant="contained" color="secondary"> | ||
<Box p={2} bgcolor="secondary.main" color="primary.contrastText"> | ||
Client only | ||
</Button> | ||
</Box> | ||
</NoSsr> | ||
</div> | ||
); | ||
} | ||
|
||
SimpleNoSsr.propTypes = { | ||
classes: PropTypes.object.isRequired, | ||
}; | ||
|
||
export default withStyles(styles)(SimpleNoSsr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,18 @@ | ||
import React from 'react'; | ||
import { withStyles, WithStyles } from '@material-ui/core/styles'; | ||
import NoSsr from '@material-ui/core/NoSsr'; | ||
import Button from '@material-ui/core/Button'; | ||
|
||
const styles = (theme: any) => ({ | ||
button: { | ||
display: 'block', | ||
margin: theme.spacing(2), | ||
}, | ||
}); | ||
|
||
export interface iProps extends WithStyles<typeof styles> {} | ||
|
||
function SimpleNoSsr(props: iProps) { | ||
const { classes } = props; | ||
import Box from '@material-ui/core/Box'; | ||
|
||
export default function SimpleNoSsr() { | ||
return ( | ||
<div> | ||
<Button className={classes.button} variant="contained" color="primary"> | ||
Server & Client | ||
</Button> | ||
<Box p={2} bgcolor="primary.main" color="primary.contrastText"> | ||
Server and Client | ||
</Box> | ||
<NoSsr> | ||
<Button className={classes.button} variant="contained" color="secondary"> | ||
<Box p={2} bgcolor="secondary.main" color="primary.contrastText"> | ||
Client only | ||
</Button> | ||
</Box> | ||
</NoSsr> | ||
</div> | ||
); | ||
} | ||
|
||
export default withStyles(styles)(SimpleNoSsr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters