如何在不使用 Owl Carousel 2 组件的情况下在 React 中实现 Owl Carousel?
How can I implement Owl Carousel in react without use the Owl Carousel 2 component?
当我使用 Owl Carousel 2 组件需要更新时,如何在 React 中实现 Owl Carousel 2:
react-dom.development.js:12357 警告:componentWillReceiveProps 已重命名,不建议使用。详情见脸书me/react-unsafe-component-lifecycles
- 将数据获取代码或副作用移至 componentDidUpdate。
- 如果您在道具更改时更新状态,请重构您的代码以使用记忆技术或将其移至静态 getDerivedStateFromProps。了解更多信息:fb.me/react-derived-state
- 将 componentWillReceiveProps 重命名为 UNSAFE_componentWillReceiveProps 以在非严格模式下抑制此警告。在 React 17.x 中,只有 UNSAFE_ 名称有效。要将所有已弃用的生命周期重命名为新名称,您可以在项目源文件夹中 运行
npx react-codemod rename-unsafe-lifecycles
。
请更新以下组件:Owl轮播
所以,我想知道如何在没有组件 OwlCarousel2 的情况下在 React 中实现库。
谢谢。
根据 Owl Carousel 的 Github 回购,它已被弃用。
https://github.com/OwlCarousel2/OwlCarousel2
他们建议使用以下内容:https://github.com/ganlanyuan/tiny-slider
当我使用 Owl Carousel 2 组件需要更新时,如何在 React 中实现 Owl Carousel 2:
react-dom.development.js:12357 警告:componentWillReceiveProps 已重命名,不建议使用。详情见脸书me/react-unsafe-component-lifecycles
- 将数据获取代码或副作用移至 componentDidUpdate。
- 如果您在道具更改时更新状态,请重构您的代码以使用记忆技术或将其移至静态 getDerivedStateFromProps。了解更多信息:fb.me/react-derived-state
- 将 componentWillReceiveProps 重命名为 UNSAFE_componentWillReceiveProps 以在非严格模式下抑制此警告。在 React 17.x 中,只有 UNSAFE_ 名称有效。要将所有已弃用的生命周期重命名为新名称,您可以在项目源文件夹中 运行
npx react-codemod rename-unsafe-lifecycles
。
请更新以下组件:Owl轮播
所以,我想知道如何在没有组件 OwlCarousel2 的情况下在 React 中实现库。
谢谢。
根据 Owl Carousel 的 Github 回购,它已被弃用。 https://github.com/OwlCarousel2/OwlCarousel2
他们建议使用以下内容:https://github.com/ganlanyuan/tiny-slider