#Unable to import specific react component

4 messages · Page 1 of 1 (latest)

noble finch
#

I think this is a Vite thing, what should I do to prevent this?

An issue from 2017 makes me think it's related to how its imported or how Vite is doing stuff. Can I tell Vite to leave this one alone?

https://github.com/glennreyes/react-countup/issues/68

import CountUp from 'react-countup';

...


<CountUp delay={2} end={100} />
GitHub

When I try to run: bundle.js:1577 Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.

#

Sometimes if I trigger a HMR it actually works fine until the next refresh, so its def a Vite thing

tidal junco
#

Try making a wrapper for this component? That should fix it?

ancient fable
#

Are you importing it into an Astro component or a React component?