I installed materialUI, emotion/react and emotion/styled as required but can’t get MUI to work on my react app. Nothing shows up on my webpage and theres no errors or anything in the console
Here’s the code:
import { Button } from '@mui/material';
import './App.css';
function App() {
return (
<div className='app'>
<Button>Hello</Button>
</div>
)
}
export default App;
If I take away the MUI Button stuff, and simply put in an h1 tag, it works fine and shows up on the console/webpage, but anything MUI related doesn’t
2
Answers
try to wrap your code into
<ThemeProvider>
.After installing "@mui/material", "@emotion/styled", " @emotion/react" You simply need to import this way.
And remove the default ‘App.css"
For more refer official Documentation