简体   繁体   中英

Why am I getting this error when using Material UI?

I used npm install @mui/material and npm install @mui/icons-material right after to import a search icon. my code looks like this

import {Search} from "@mui/icons-material";

However, when I write it in my code as <Search /> I get this error.

在此处输入图像描述

What is the issue?

The package you are trying to use is a set of react components. In other words, you can't use it without React. Have a look at this .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM