(SiteCore newbie here)
I'm currently working on a JSS React project. I created an
Icons component which will export different icons as named exports:
export const Icon1 = () => <svg>...</svg>; export const Icon2 = () => <svg>...</svg>;
But when attempting to use one of those in a page, I got the following message:
./src/temp/componentFactory.js Attempted import error: '../components/Icons' does not contain a default export (imported as 'Icons').
After reading the script which generates the
componentFactory.js I noticed that it assumes all components will be default exports.
The only options I can see to fix this are:
- Update the script so it can add named exports
- Disable the automatic generation of the file an manually add each component
Is there anything else I'm missing here? Thanks in advance.