Skip to content

Commit 3738008

Browse files
committed
remove derived state
1 parent 0568e60 commit 3738008

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

docs/src/modules/components/DemoSandboxed.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ const styles = (theme) => ({
2121
function DemoFrame(props) {
2222
const { children, classes, ...other } = props;
2323
const theme = useTheme();
24-
const [state, setState] = React.useState({
25-
ready: false,
26-
});
24+
const [state, setState] = React.useState(null);
2725

2826
/**
2927
* @type {import('react').Ref<Window | null>}
@@ -37,7 +35,6 @@ function DemoFrame(props) {
3735

3836
const onContentDidMount = () => {
3937
setState({
40-
ready: true,
4138
jss: create({
4239
plugins: [...jssPreset().plugins, rtl()],
4340
insertionPoint: jssInsertionPointRef.current,
@@ -62,7 +59,7 @@ function DemoFrame(props) {
6259
{...other}
6360
>
6461
<div ref={jssInsertionPointRef} />
65-
{state.ready ? (
62+
{state !== null ? (
6663
<StylesProvider jss={state.jss} sheetsManager={state.sheetsManager}>
6764
{React.cloneElement(children, {
6865
window: state.window,

0 commit comments

Comments
 (0)