react-native-calendars: Warning: componentWillReceiveProps has been renamed, and is not recommended for use

Description

Update react native expo to SDK 35.0.0. Calendar throws a warning.

Expected Behavior

No warning.

Observed Behavior

Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks 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.

Please update the following components: Calendar, CalendarList

Environment

Please run these commands in the project folder and fill in their results:

  • npm ls react-native-calendars: react-native-calendars@1.214.0
  • npm ls react-native: react-native@0.61.4

Also specify:

  1. Phone/emulator/simulator & version: iPhone 8, iOS 12.2

Reproducible Demo

Just update to newest version of react-native (0.61) and expo (SDK 35.0.0) [if expo is used]. Then simply import CalendarList and render it, and warning will be shown.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 10
  • Comments: 16 (1 by maintainers)

Most upvoted comments

@Itayp1 @jet2go Do you get this warning with versions later than 1.226.0?

I m getting error in 1.261.0

This is very annoying issue. I don`t think that this will take much time to solve this problem, so please update it asap.