There have been a lot of changes and improvements coming through the pipeline recently with
react-native-elements. So in preparing for a version 3, there are some planned deprecations that will be added into version 2.3 and then removed in version 3.
The reason for these changes is that
react-native-elements regularly gets requests for new features and enhancements quite frequently. The fast and easy method of adding these new features is usually to add another prop into the component that then injects some change into a child component. Unfortunately, this ends up leading to the components having a lot of props, lots of conditional code, and additional code complexity. The solution going forward and into version 3 will be to break down large components into smaller pieces so that it is easier to inject your own code without having to wait for an additional prop to be added.
As we continue to build up to version 3, this post will continue to be updated with new step-by-step directions on how to upgrade your code to work around these changes. The RNE team thanks you for your patience, and we hope that you see the value in the upcoming changes.
accessoryProps are all being dprecated. There is now a child component
Avatar.Accessory that you insert as a child component instead.
ListItem has a large number of deprecated props.
ListItem has been somewhat of a kitchen sink. All the props can be replaced by inserting them as children in the order of left to right as they appear on the screen.
leftElement, leftIcon, leftAvatar, rightElement, rightIcon, rightAvatar
These can be replaced by using
Avatar components respectively.
title, titleStyle, titleProps, subtitle, subtitleProps, subtitleStyle
These props can be replaced by
These props should be placed in the
style prop of
rightTitle, rightTitleStyle, rightTitleProps, rightSubtitle, rightSubtitleStyle, rightSubtitleProps
These props also use
ListItem.Subtitle. Simply add the prop
right to each one.
input, buttonGroup, switchProps, checkBox, badge, chevron, checkmark
input prop can be replaced with
buttonGroup prop can be replaced with
switchProps prop can be replaced with
checkBox prop can be replaced with
badge prop can be replaced with
chevron prop can be replaced with
checkmark prop can be replaced with :
Card the following props have all been deprecated:
title, titleStyle, titleNumberOfLines
Move these props into
The divider and the
dividerStyle itself were moved into
image, imageStyle, imageProps, imageWrapperStyle
These can be replaced with
Card.Image which accepts all
imageWrapperStyle can be attached to a
View that wraps the
featuredTitle, featuredTitleStyle, featuredSubtitle, featuredSubtitleStyle
These were both replaced with
BottomSheet was added in version 2.2, and it was noted that it had some strict dependencies that weren't so well liked. So
BottomSheet has changed completely and it is encouraged that you checkout the docs page on it again.
Make sure to checkout the customization page. We added a dark mode configuration to the
ThemeProvider that should help out in bootstraping your app's dark mode.