1

I'm trying to load components from the src/components folder (which works perfectly) and also from the src/icons, which doesn't load anything:

sections: [
    {
      name: 'Components',
      components: path.join(__dirname, 'src/components/**/*.jsx')
    },
    {
      name: 'Icons',
      components: path.join(__dirname, 'src/icons/*.jsx')
    }
  ],

I've also tried to put the icon components within their own folders (like with the normal components) but that didn't fix it, So the issue must be something else.

The structure of the icon components is the same as in the material-ui lib:

import React from 'react';
import createSvgIcon from './utils/createSvgIcon';

export default createSvgIcon(
  <React.Fragment><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /><path fill="none" d="M0 0h24v24H0z" /></React.Fragment>
  , 'Warning'
);

This is the createSvgIcon helper: https://github.com/mui-org/material-ui/blob/master/packages/material-ui-icons/src/utils/createSvgIcon.js

Why the icon components are not loading? I don't get any error :/

Joan Mira
  • 279
  • 1
  • 4
  • 9

0 Answers0