refactor(#2801): Remove defaultProps api for function components - #2812
Open
sbaechler wants to merge 2 commits into
Open
refactor(#2801): Remove defaultProps api for function components #2812sbaechler wants to merge 2 commits into
sbaechler wants to merge 2 commits into
Conversation
sbaechler
commented
Jun 28, 2024
|
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. |
Author
@vladdg-dev defautProps are only deprecated for function components. They are still supported for class components and all other components are class components. |
sbaechler
force-pushed
the
remove-default-props-api
branch
from
August 7, 2024 14:15
daea35f to
ed2555e
Compare
sbaechler
force-pushed
the
remove-default-props-api
branch
from
August 7, 2024 14:45
ed2555e to
9e60c71
Compare
|
We need this. Some components are referencing I get the warning when I use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).