gilbarbara / react-inlinesvg

An SVG loader component for ReactJS

Home Page:https://codesandbox.io/s/github/gilbarbara/react-inlinesvg/tree/main/demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'react_from_dom_1.default is not a function'

adamcbrewer opened this issue · comments

I have two projects I'm currently working on, one of which is a library of components using react-inlinesvg (project A) and another which imports the library (project B).

Project A has no issues with react-inlinesvg, but it's compiled to UMD using rollup. Importing any component from project A which uses react-inlinesvg seems to throw an error with the following error:

react_from_dom_1.default is not a function'

After a little digging I've found that when react-inlinesvg requires react-from-dom for some reason there is no 'default' export.

I'm thinking it might be because of a difference between our UMD and the ESM modules from react-inlinesvg. It might possibly be related to this similar issue which resolves it by using a star import.

Hey,

This seems like a problem with rollup configuration.
Changing the typescript config isn't an option since it would force users to have the same config

I'm actually having the same issue elsewhere so you're definitely right, thanks!