This is a migrated thread and some comments may be shown as answers.

Spreadsheet deprecated warnings for React 17

1 Answer 218 Views
Wrappers for React
This is a migrated thread and some comments may be shown as answers.
IT Dept
Top achievements
Rank 1
IT Dept asked on 25 Nov 2020, 06:23 PM

Kendo UI React Wrapper Spreadsheet has the following warning and will stop working with React 17 (which is out now, and I'm planning to upgrade to once a couple other dependencies update to it as well).

 

react_devtools_backend.js:2430 Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://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: https://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.

Can this be updated or a native React spreadsheet be implemented?

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 26 Nov 2020, 12:30 PM

Hello, Eric,

I have escalated this question as currently, we are not working on the wrappers as all they do is internally initialize the Kendo UI for jQuery component using this approach:

https://docs.telerik.com/kendo-ui/third-party/react#kendo-ui-for-jquery-in-react-applications

We have made an example of how to make the custom wrapper for the Spreadsheet. This is the full code, that replaces the componentWillReceiveProps with componentDidUpdate. You can replace the wrapper with this and everything should be working as expected:

https://stackblitz.com/edit/react-6sn1dm-cxqjxw?file=app%2FSpreadsheet.jsx

Once I have more official information and the official support for React 17, I will update this thread.

Regards,
Stefan
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Wrappers for React
Asked by
IT Dept
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or