#javascript #reactjs
Вопрос:
На этом СтекбЛитце: https://stackblitz.com/edit/react-7moa7n
У меня есть очень простой код, который выглядит следующим образом:
import React from "react";
import "./style.css";
import InfiniteCalendar from 'react-infinite-calendar';
import 'react-infinite-calendar/styles.css';
export default function App() {
return (
<div>
<h1>Hello StackBlitz!</h1>
<p>Start editing to see some magic happen :)</p>
<InfiniteCalendar />
</div>
);
}
Моя проблема в том, что модуль: react-infinite-calendar
выдает следующие предупреждения:
Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/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: https://reactjs.org/link/derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.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: DefaultCalendar, MonthList, TransitionGroup, VirtualList, withPropsOnChange(Day), withPropsOnChange(withState(withProps(Calendar)))...
preview-e2b44a68570359ddfd71b.js:1 Warning: componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
* Move data fetching code or side effects to componentDidUpdate.
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.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: Calendar
как вы можете видеть на изображении ниже.
Приложение, в которое я интегрирую этот модуль, не может иметь такого рода предупреждений.
Есть идеи, как это решить? или каковы мои варианты?
Спасибо!