backgroundVideo icon indicating copy to clipboard operation
backgroundVideo copied to clipboard

How do you import this in React?

Open Adonais0 opened this issue 6 years ago • 7 comments

I use ES6 import import { BackgroundVideo } from "background-video";, it shows error TypeError: Cannot call a class as a function. How can we import this?

Adonais0 avatar Dec 28 '18 02:12 Adonais0

Anyone ever figure this out?

23twenty avatar Feb 19 '19 21:02 23twenty

Did you try import BackgroundVideo from "background-video"; ?

linnett avatar Feb 19 '19 21:02 linnett

Yes, I get the same error as above.

Did you try import BackgroundVideo from "background-video"; ?

23twenty avatar Feb 19 '19 21:02 23twenty

Of course. To be he honest I need to spend a bit of time re-factoring this as it's very old and unmaintained currently.

For now I'd recommend importing the dist (import my/path/to/backgroundVideo/dist/backgroundVideo.js). I've never tested it with React as this was a pure JS solution when I made it.

I'll try and find some time if someone wants to make a PR I'd be happy to review.

linnett avatar Feb 19 '19 22:02 linnett

Unfortunately that yeilds the same result. I guess it has to do with how the module is created; I'd love to make a PR but this is honestly not in my wheelhouse. Any work on this would be super appreciated!

23twenty avatar Feb 19 '19 22:02 23twenty

I know how to fix but it's time. I'll do my best to find some

On Tue, 19 Feb 2019, 22:22 23twenty <[email protected] wrote:

Unfortunately that yeilds the same result. I guess it has to do with how the module is created; I'd love to make a PR but this is honestly not in my wheelhouse. Any work on this would be super appreciated!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/linnett/backgroundVideo/issues/40#issuecomment-465335267, or mute the thread https://github.com/notifications/unsubscribe-auth/ACI_wefcQ2sv0_3jKq0VOMG3e9LsSCRoks5vPHkbgaJpZM4ZjYyS .

linnett avatar Feb 19 '19 22:02 linnett

Same in VueJS

kgrosvenor avatar Oct 14 '19 10:10 kgrosvenor