Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@sbaechler
Copy link

  • Bug fix
  • New feature
  • Chore
  • Breaking change
  • There is an open issue which this change addresses
  • I have read the CONTRIBUTING document.
  • My commits follow the Git Commit Guidelines
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • My change requires a change to Typescript typings.
    • I have updated the typings accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Fixes #2801

This pull request is based on #2806 by @islam-kamel.

The defaultProps were removed from the 3 functional components Fade, Tooltip and Popover.

It does require a new method that actively checks the props for undefined. Most likely because propTypes adds props that are not passed-in. However, the new method only does a shallow comparison (since functional components only do a shallow compare).

src/Fade.js Outdated Show resolved Hide resolved
@vladdg-dev
Copy link

Please remove defaultProps for all affected components. It's not only Fade, Tooltip and Popover. It's also Nav, NavItem, Badge, Breadcrumb, BreadcrumbItem, Container, Row, Col, Card, CardHeader, CardBody. Thank you.

@sbaechler
Copy link
Author

Please remove defaultProps for all affected components. It's not only Fade, Tooltip and Popover. It's also Nav, NavItem, Badge, Breadcrumb, BreadcrumbItem, Container, Row, Col, Card, CardHeader, CardBody. Thank you.

@vladdg-dev defautProps are only deprecated for function components. They are still supported for class components and all other components are class components.

@sbaechler sbaechler force-pushed the remove-default-props-api branch from daea35f to ed2555e Compare August 7, 2024 14:15
@mizozobu
Copy link

mizozobu commented Mar 8, 2025

We need this. Some components are referencing Fade.defaultProps, but Fade.defaultProps is undefined.

I get the warning when I use Toast.

Warning: Failed prop type: The prop `timeout` is marked as required in `Fade`, but its value is `undefined`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.