/** @format */
import React from 'react';
import './Home.css';
import OwlCarousel from 'react-owl-carousel';import 'owl.carousel/dist/assets/owl.carousel.css';import 'owl.carousel/dist/assets/owl.theme.default.css';
const Home = () => {
const options = {autoplay: true,autoplayTimeout: 4000,autoplayHoverPause: true,items: 1,mouseDrag: true,stagePadding: 5,center: true,nav: false,margin: 50,dots: true,loop: true,responsive: {0: { items: 1 },480: { items: 1 },575: { items: 2 },768: { items: 2 },991: { items: 3 },1200: { items: 3 },},};
return (<section>
<div className='container carousel'>
<h4 className='text-center m-3 head-title'>Our Completed Projects</h4>
<OwlCarousel {...options}>
</OwlCarousel>
</div>
</section>
);};
export default Home;
`react-dom.development.js:86 警告:不建议在严格模式下使用 UNSAFE_componentWillReceiveProps,这可能表明代码中存在错误。有关详细信息,请参阅https://reactjs.org/link/unsafe-component-lifecycles。
请更新以下组件:ReactOwlCarousel `
这是开发错误,这是由于 React 社区更改了某些方法而出现的,这不是大问题,因为这在部署时也不可见,您可以进一步编码,没有任何问题。