gilbarbara/react-inlinesvg

SVG is not a constructor function for JSX elements

valtism opened this issue · 10 comments

I get the title error when trying to use the V1.0.0 library in the way defined in the README. I also get another error: JSX element does not support attributes because it does not have a 'props' property.

I'm not sure if these warnings are accurate, but I cannot compile with Storybook with these changes.

Apologies if I am seriously off the mark here. I'm extremely new to React and Typescript.

Screen Shot 2019-07-19 at 17 05 05

Hey @valtism
I need more information:
Are you using create-react-app or a custom webpack? Which typescript version tsc --version?

This is not using create-react-app, we are using a custom Webpack. The Typescript version is 2.9.2

My suggestion is to upgrade some packages. It could be @types/react or the typescript itself.

It does seem to be somewhat involved with @types/react but I can't seem to pin it down in our repository. I can confirm that it works with create-react-app.

Alright! I'm closing this issue since there's not much else I can do.
Good luck!

@gilbarbara This only happens on >= 1.0.0. 0.8.4 has no issues. I downgraded to 0.8.4 for now.

Using Typescript latest version. Extension interfere with something else or something is wrongly coded -i don't know for sure-. Can you check this please?

P.S.: This is already ongoing rails project but not a project created via create-react-app

@gencer I already checked this...
Please post the versions of react, @types/react and typescript

@valtism @gencer Please try 1.1.2 and let me know if it works

@gilbarbara Sorry for late reply. I was going to post versions, however, I tested against 1.1.2 and it works!

Thank you so much for this extension and your fast help!

🎉

Oh, forgot to comment on this, but this fix did work and we now have this in production! Thanks @gilbarbara!!