-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
useTheme
hook - 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
labelStyle
prop
** BREAKING CHANGE**
- change prop
image
toicon
Features:
- add
contentStyle
prop
Bug Fixes:
- use
active
instead oftext
for ripple color
Bug Fixes:
- use own
ActivityIndicator
instead the one from React-Native - do not apply elevation on outlined button
Features:
- add labelStyle prop
Bug Fixes:
- fix Card flow type
Features:
-
leftStyle
andrightStyle
Bug Fixes:
- update
close
icon tomaterial community icons
- types correction
Features:
-
onLongPress
handler -
textStyle
prop
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
testID
prop
Bug Fixes:
- fix button scaling
Features:
- (title|description)numberOfLines prop
- add titleStyle and descriptionStyle props
Bug Fixes:
- properly render
description
prop - icon spacing
Features:
- add (title|description)numberOfLines prop
- add
titleStyle
anddescriptionStyle
props
Bug Fixes:
- apply animation scale from
theme
to 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
contentStyle
prop - 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
editable
anddisable
props behavior
Features:
- add ability to change
fontSize
,height
andfontWeight
- allow to make inputs uncontrolled with defaultValue
Bug Fixes:
- add letter-spacing that follows guidelines