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>
)

1 answer

  • answered 2022-05-06 20:47 gavin

    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

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum