0

Material UI code

I am using React Material ui. Tried to use ToolBar and AppBar component of Material UI. But while using this i got the following error.Module not found: Can't resolve 'material-ui/core/Toolbar'

I've done some research and removed the packages and reinstalled them. However, I keep getting the same error i tried to import using both the ways to import

Not sure why this issue happens.Is there any issue with the @material-ui/core version i am using ?

```
import React from 'react'
import AppBar from '@material-ui/core/AppBar';
import Toolbar from 'material-ui/core/Toolbar';
import {
    ListItem,
    IconButton,
    ListItemText,
    Avatar,
    Divider,
    List,
    Typography,
    Box
} from '@material-ui/core';
import {
    ArraowBack,
    AssignmentInd,
    Home,
    Apps,
    ContactMail,
    ArrowBack
} from "@material-ui/icons"

const Navbar = () => {
    return (
        <Box component="nav">
            <AppBar>
            <Toolbar>
                    <ArrowBack>

                    </ArrowBack>
                </Toolbar>  
            </AppBar>

        </Box>
    )
}

export default Navbar;

```

I am using React Material ui. Tried to use ToolBar and AppBar component of Material UI. But while using this i got the following error.Module not found: Can't resolve 'material-ui/core/Toolbar'

I've done some research and removed the packages and reinstalled them. However, I keep getting the same error i tried to import using both the ways to import

Not sure why this issue happens.Is there any issue with the @material-ui/core version i am using ?

2
  • 1
    Its @material-ui/core/Toolbar... Steps for debugging that should have been taken: 1) What's different about this component compared to the other ones that don't error? 2) How does the documentation show how to use this component? Commented May 22, 2020 at 19:05
  • Thank you I will take a note of your suggestion Commented May 22, 2020 at 19:11

1 Answer 1

2
import Toolbar from '@material-ui/core/Toolbar';
// or
import { Toolbar } from '@material-ui/core';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.