Skip to content

[React] Stop using defaultProps for compatibility with React 18.3+ #1838

@quicksketch

Description

@quicksketch

Using many of the React Mayflower components on a React 18.3+ projects will throw a warning upon starting the application such as this:

Warning: Image: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

Using defaultProps is deprecated (per facebook/react#25699) and should be replaced with normal JavaScript parameter defaults. There's a pretty good write up on the situation here: https://sophiabits.com/blog/stop-using-defaultprops

  • Mayflower version: 12.6.0
  • Operating system and version: Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions