react stories doesnt shows font awesome icon
See original GitHub issueHello there. I created a component with fontawesome icon. It works fine but it doesnt shows in my stories. I imported @fortawesome files and added fas to the library in the preview.js. Then my story shows “Cannot read property ‘icon’ of undefined”. Anyone know why?
preview.js
import { library } from "@fortawesome/fontawesome-svg-core";
import { fas } from "@fortawesome/free-solid-svg-icons";
library.add(fas);
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
};
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
Font awesome icons are not displaying react - Stack Overflow
Your import looks wrong import '././styles/fontawesome/css/fontawesome.min.css'; you're probably looking for import '../.
Read more >How To Use Font Awesome 5 with React - DigitalOcean
In this tutorial you'll explore how to use the React Font Awesome component. Font Awesome website with its icons. Prerequisites. No coding is ......
Read more >Troubleshoot | Font Awesome Docs
I'm getting a Babel/Babel-loader error when using React Font Awesome. If you're using a Mac or Linux, make sure you are up to...
Read more >Nuxt.js and FontAwesome — a simple walk-through
The <font-awesome-icon :icon="['fas', 'envelope']"/> is generated by nuxtjs/fontawesome module to call Font Awesome icons. Every time you need to add an icon, ...
Read more >Font awesome icons in Kendo Toolbar not visible - Telerik
Hi, I have the following Toolbar but all the Font awesome Icons are invisible? adding the style as discribed in the docs doesn't...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Actually I figure it out that what you need is import the files inside preview.js/.ts
We’re on the same boat 😞 Trying to get font awesome icons to work on storybook with react. No bueno 😕