Received error Attempted import error: 'NotificationsNoneIcon' is not exported from '@material-ui/icons'

Viewed 1571

I am trying to write my code, I imported my css file but it doesn't while its address is correct , also I receive this error :

./src/components/topbar/Topbar.jsx
Attempted import error: 'NotificationsNoneIcon' is not exported from '@material-ui/icons'.

While I ran these commands :

npm install @material-ui/core
npm install @material-ui/icons

Here is my code : could you help me ?

import React from 'react';
import './topbar.css';
import {NotificationsNoneIcon} from '@material-ui/icons';

    function Topbar() {
        return (
            <div className="topbar">
                <div className="topbarWrapper">
                    <div className="topleft">
                        <span className="logo">lammadamin</span>
                    </div>
                    <div className="topright">
                        <div className="topbarIcons">
                            <NotificationsNoneIcon/>
                        </div>
                    </div>
                </div>
            </div>
        )
    }
    
    export default Topbar
2 Answers

Import NotificationsNone instead of NotificationsNoneIcon

The main problem is you tried to import from @material-ui/icons while the documentation suggests @material-ui/icons/NotificationsNone to do so.

Based on the documentation you should import as:

import NotificationsNoneIcon from '@material-ui/icons/NotificationsNone'

Read further here: https://material-ui.com/components/material-icons/

Related