Skip to content
Advertisement

Why is my React MUI component not showing?

I am trying to use the MUI drawer component alongside with React router to display a simple navbar on the left of the page. I am very new to react and am not sure what I am doing wrong as the code compiles fine. The other two pages “Signup” and “Login” are showing up fine. The way the project is structured is I have a separate folder in Components for each page of the website. Then in app.js there is a router which should have a link to each page. I do not have components separated and am trying to have a Drawer as well as other components all in one page titled Dashboard.js

JavaScript
JavaScript

Advertisement

Answer

Change your code to this

JavaScript

I created a codesandbox from your code and onClick works there

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement