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

Below code is perfectly working in Codesandbox but not working in Stackbliz #3215

Open
rsranjeet opened this issue Dec 24, 2024 · 0 comments

Comments

@rsranjeet
Copy link

Below code is perfectly working in Codesandbox but not working in Stackbliz

Error:
Error in /turbo_modules/[email protected]/cjs/react.development.js (1205:31)
Cannot read properties of null (reading 'useContext')

import React, { useState } from 'react';
import { Backdrop, Box, Button, Typography } from '@mui/material';

const OverlayExample = () => {
const [open, setOpen] = useState(false);

const handleToggle = () => {
setOpen(!open);
};

return (



{open ? 'Close Overlay' : 'Open Overlay'}

<Backdrop open={open} style={{ zIndex: 1 }}>
<Box
sx={{
width: 300,
height: 200,
bgcolor: 'background.paper',
boxShadow: 3,
p: 4,
borderRadius: 2,
}}
>

This is an overlay


You can place any content here.




);
};

export default OverlayExample;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant