Search code examples
reactjsowl-carousel

How can I implement Owl Carousel in react without use the Owl Carousel 2 component?


How can I implement Owl Carousel 2 in react, when I use the Owl Carousel 2 component needs updates:

react-dom.development.js:12357 Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See fb.me/react-unsafe-component-lifecycles for details.

  • Move data fetching code or side effects to componentDidUpdate.
  • If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: fb.me/react-derived-state
  • Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

Please update the following components: OwlCarousel

So, I wonder how can I implement the library in React without the component OwlCarousel2 .

Thanks.


Solution

  • As per Owl Carousel's Github repo its deprecated. https://github.com/OwlCarousel2/OwlCarousel2

    They recommend to use following: https://github.com/ganlanyuan/tiny-slider