-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Migration guide for 3.0
From a user perspective, not much has changed. In general, typings are improved, they are more strict.
Due to that change, there are much more icons to use, but the names of the icons can be different between packages.
I.e more-vert from MaterialIcons is dots-vertical from MaterialCommunityIcons
The library uses MaterialCommunityIcons by default, but it is possible to specify a custom Icon component.
To use custom icon component setup properly the PaperProvider
import AwesomeIcon from 'react-native-vector-icons/FontAwesome';
// ...
<PaperProvider
settings={{
icon: props => <AwesomeIcon {...props} />,
}}
>
// ...
</PaperProvider>In version 2.x each property e.g. regular or medium in fonts object was a string and contained information about font family and weight.
In version 3.x each property in fonts object is a an object containing fontFamily and fontWeight properties. Thanks to those changes, we can support more granular font definitions in theme.
In v3.x fonts object should have following structure:
regular: {
fontFamily: 'System',
fontWeight: '400',
},
medium: {
fontFamily: 'System',
fontWeight: '500',
},
light: {
fontFamily: 'System',
fontWeight: '300',
},
thin: {
fontFamily: 'System',
fontWeight: '100',
},When you pass a font from theme to your custom component make sure to spread it, since font is an object in v3.x
style={{
...theme.fonts.regular
}}- export
useThemehook - new dark theme colors, compliant with Material Design Guidelines
Bug Fixes:
- do not pass any additional props to custom children components
Bug Fixes:
- add elevation to wrapper style on Android
Features:
- add
labelStyleprop
** BREAKING CHANGE**
- change prop
imagetoicon
Features:
- add
contentStyleprop
Bug Fixes:
- use
activeinstead oftextfor ripple color
Bug Fixes:
- use own
ActivityIndicatorinstead the one from React-Native - do not apply elevation on outlined button
Features:
- add labelStyle prop
Bug Fixes:
- fix Card flow type
Features:
-
leftStyleandrightStyle
Bug Fixes:
- update
closeicon tomaterial community icons - types correction
Features:
-
onLongPresshandler -
textStyleprop
Features:
- add scale property to control cross fade icon animation time
Bug Fixes:
- fix bug with applying background color
Bug Fixes:
- always display activity indicator if loading property is set to true
Features:
- support loading indicator for FAB
Bug Fixes:
- remove StatusBar from FAB Group
- icon type in
actions
Features:
- add
testIDprop
Bug Fixes:
- fix button scaling
Features:
- (title|description)numberOfLines prop
- add titleStyle and descriptionStyle props
Bug Fixes:
- properly render
descriptionprop - icon spacing
Features:
- add (title|description)numberOfLines prop
- add
titleStyleanddescriptionStyleprops
Bug Fixes:
- apply animation scale from
themeto animations in Menu. - disable menu interaction while hiding
- reduce menu open delay
- dismiss menu on window layout change
- properly handle back button press in menu
- fix the alignment issue
Features:
- add
contentStyleprop - make the menu keyboard-accessible on web
Bug Fixes:
- wrap modal children in
SafeAreaView - disable interaction when fading out modal
Features:
- contentContainerStyle prop
Bug Fixes:
- fix animation
Features:
- inputStyle prop
- custom icon for clear button
Bug Fixes:
- consistent elevation behavior across platforms
Bug Fixes:
- fix adjustsFontSizeToFit does not exist on TextInput error
- fix disappearing placeholder on web
- fix typescript error when setting ref
- pass flattened styles to adjustPadding
- use theme font in TextInputFlat
- fix
editableanddisableprops behavior
Features:
- add ability to change
fontSize,heightandfontWeight - allow to make inputs uncontrolled with defaultValue
Bug Fixes:
- add letter-spacing that follows guidelines