Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARN: defaultProps will be removed from memo components #748

Open
ChromeQ opened this issue May 13, 2024 · 2 comments
Open

WARN: defaultProps will be removed from memo components #748

ChromeQ opened this issue May 13, 2024 · 2 comments
Labels

Comments

@ChromeQ
Copy link

ChromeQ commented May 13, 2024

Environment

System:
  OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
  CPU: (16) x64 12th Gen Intel(R) Core(TM) i7-1270P
  Memory: 11.53 GB / 30.78 GB
  Shell:
    version: 5.1.16
    path: /bin/bash
Binaries:
  Node:
    version: 20.13.1
    path: ~/.nvm/versions/node/v20.13.1/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.yarn/bin/yarn
  npm:
    version: 10.5.2
    path: ~/.nvm/versions/node/v20.13.1/bin/npm
  Watchman: Not Found
SDKs:
  Android SDK:
    Android NDK: 26.1.10909125
IDEs:
  Android Studio: Not Found
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.1
    wanted: 0.74.1
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Platforms

Only tested Android

Versions

Description

Updating to the latest expo (v51.0.4) updated react-native to 0.74.1 and now opening my app using this package throws the following warning:

 ERROR  Warning: Unknown: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.
    in RCTView (created by View)
    in View (created by MemoTimeInput)

Tracked it down to my component MemoTimeInput which renders this package like so:

import DateTimePickerModal, { ReactNativeModalDateTimePickerProps } from 'react-native-modal-datetime-picker';
// ...
<DateTimePickerModal
        isVisible={true}
        mode="time"
        date={new Date()}
        onConfirm={() => {}}
        onCancel={() => {}}
        minuteInterval={15}
        is24Hour={false}
      />

Looking at source code I see the following:

DateTimePickerModal.defaultProps = {

Commenting those defaultProps out fixes the issue.

@ChromeQ ChromeQ added the bug label May 13, 2024
@kenil84
Copy link

kenil84 commented May 31, 2024

Hello, have you been able to find a solution for this? I am also getting warning in my project.

@ChromeQ
Copy link
Author

ChromeQ commented May 31, 2024

The solution is to refactor or rewrite the component, or use patch-package to comment it out.

Unfortunately not much will happen without @mmazzarolo, happy to create a PR if you would merge it @mmazzarolo?

Last commit was over 8 months ago so I won't hold my breath for a quick turnaround to this one. I might fork and fix and let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants