admin管理员组文章数量:1310415
I've installed the react-icons module correctly with npm, and everything is working great. I can import icons without any errors, but sadly whenever I try and import an icon with Io
before it like
simply like:
import { IoSettingsOutline } from 'react-icons/io'
class Home extends Component{
render(){
return (
<div className="app">
<Link to='/settings'>
<IoSettingsOutline className="settings-icon"/>
</Link>
</div>
)
}
};
I get the error:
./src/Home.js Attempted import error: 'IoSettingsOutline' is not exported from 'react-icons/io'.
And what's funny about this is, I've imported every other icon just like this, switching out the name and the ending of 'react-icons/io'
What is happening and how can I fix this?
I've installed the react-icons module correctly with npm, and everything is working great. I can import icons without any errors, but sadly whenever I try and import an icon with Io
before it like
simply like:
import { IoSettingsOutline } from 'react-icons/io'
class Home extends Component{
render(){
return (
<div className="app">
<Link to='/settings'>
<IoSettingsOutline className="settings-icon"/>
</Link>
</div>
)
}
};
I get the error:
./src/Home.js Attempted import error: 'IoSettingsOutline' is not exported from 'react-icons/io'.
And what's funny about this is, I've imported every other icon just like this, switching out the name and the ending of 'react-icons/io'
What is happening and how can I fix this?
Share Improve this question edited Jul 13, 2021 at 21:04 Buddy Bob asked Jul 13, 2021 at 20:18 Buddy BobBuddy Bob 5,8891 gold badge18 silver badges49 bronze badges 2-
2
There are different
Ionicons
versions. You'll either want to import from io (which isIonicons v4
) or io5. Click on the links provided to see which icons are supported for each version. In your case,IoSettingsOutline
es fromio5
. – Matt Carlotta Commented Jul 13, 2021 at 21:24 - Ok that makes sense! – Buddy Bob Commented Jul 13, 2021 at 21:35
2 Answers
Reset to default 8as @Matt Carlotta said: "There are different Ionicons Ionicons v4 io5"
try:
import { IoSettingsOutline } from 'react-icons/io5'
The below import worked for me,
import { IoSettingsOutline } from 'react-icons/io5'
本文标签: javascriptIO icons from quotreact iconsquot not importingStack Overflow
版权声明:本文标题:javascript - IO icons from "react icons" not importing - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741832580a2400021.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论