'MUI/Icon makes everything dissapear

When I try to import and use a mui icon in react, it makes the whole div dissapear, and just the background image remain, i have installed: emotion/react, emotion/styled, mui/icons-material, mui/material, styled-components, mui/styled-engine-sc

        <div className="login">
        <h1>Login</h1>
        <div className="form">
            <EmailIcon className='icon'/>
            <input type="text" placeholder="Email"></input>
            <input type="password" placeholder='Password'></input>
        </div>
        <div className="buttons">
            <button id='login'>Login</button>
            <button id='register'>Register</button>
        </div>
    </div>
)


Solution 1:[1]

I copied your code, installed the dependencies and it worked just fine for me. I suggest updating these dependencies:

npm update @mui/material @mui/icons-material @emotion/styled @emotion/react

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 gavin