react-background-slider icon indicating copy to clipboard operation
react-background-slider copied to clipboard

compatible for recent react version

Open uprety opened this issue 3 years ago • 6 comments

I have been using this package for a while now. It is small, simple and easy to use and exactly what I wanted.

I would love to use it with latest reactjs (v17.0.2) which it has been months from its release. If anyone available for the upgrade of this package, please feel free to make pull requests. I would have done it myself but I do not know how its done. I need someone who can guide in this case. If anyone already working in it, I would be glad to hear it.

uprety avatar Jan 16 '22 06:01 uprety

I have been using this package for a while now. It is small, simple and easy to use and exactly what I wanted.

I would love to use it with latest reactjs (v17.0.2) which it has been months from its release. If anyone available for the upgrade of this package, please feel free to make pull requests. I would have done it myself but I do not know how its done. I need someone who can guide in this case. If anyone already working in it, I would be glad to hear it.

If you really need this package for latest react., download the git repo and copy the lib folder in to your project/src/lib and you can install the css-vendors manually from npm thats it ! and refer the BackgroundLibrary from 'your lib path'

I have used like this only

Arunk28 avatar Jan 18 '22 10:01 Arunk28

A prerelease that is compatible with React v18 is available for testing on npm: 3.0.0-0

u2ix avatar Aug 25 '22 06:08 u2ix

Thanks for the version, now I try to use this version 3.0.0-0 with react 18.2.0 and typescript. But it doesn't work, it shows these errors in the console.

Warning: React.jsx: Invalid type: Expected a string (for built-in components) or a class/function (for composite components) but got: object.

I make several attempts but I get the same error. Does anyone know how to fix it?

Diana-M-Gonzalez-P avatar Aug 30 '22 20:08 Diana-M-Gonzalez-P

Yeah, i have the same problem. Console shows me: Expected a string (for built-in components) or a class/function (for composite components) but got: object.

Maybe some help?

SzumielDev avatar Sep 21 '22 12:09 SzumielDev

It isn't being exported correctly. Here is a workaround

import BackgroundSlider from 'react-background-slider';
  
// @ts-ignore Workaround for bug on react-background-slider 
const Slider = BackgroundSlider['react-background-slider'].default;

// Use as normal
const MyComponent = () => <Slider images={images} duration={5} transition={0.5} />

drewjenkins avatar Sep 28 '22 16:09 drewjenkins

@drewjenkins Thank you so much, that worked for me in electronjs.

SharlSherif avatar Oct 28 '22 22:10 SharlSherif

Hi @drewjenkins, thanks your comment. Do you have an idea what needs to be changed inside the package to export it correctly?

u2ix avatar Apr 02 '24 19:04 u2ix

Nevermind, sorry for the delay. There is now a new pre-version on npm with updated versions and hopefully the export issue is also solved. Update using:

npm i [email protected]

u2ix avatar Apr 03 '24 15:04 u2ix

Please update to the latest version and reopen a new issue if you experience troubles with the latest react version.

npm i [email protected]

Thanks for your participation and support.

u2ix avatar Apr 04 '24 17:04 u2ix