yarn global add jscodeshift
git clone https://github.com/callstack/react-native-paper-codemod.git
or download a zip file fromhttps://github.com/callstack/react-native-paper-codemod/archive/master.zip
- Run
yarn install
in the react-native-paper-codemod directory jscodeshift -t <codemod-script> <path>
codemod-script
- path to the transform file, see available scripts below;path
- files or directory to transform;- use the
-d
option for a dry-run and use-p
to print the output for comparison; - use the
--extensions
option if your files have different extensions than.js
(for example,--extensions js,jsx
); - if you use flowtype, you might also need to use
--parser=flow
; - see all available jscodeshift options.
Migrate codebase using react-native-paper v1.0 to v2.0. The full list of breaking changes can be found here.
jscodeshift -t react-native-paper-codemod/transforms/material-next.js <path>
Toolbar
→Appbar.Header
ToolbarBackAction
→Appbar.BackAction
ToolbarContent
→Appbar.Content
CardActions
→Card.Actions
CardContent
→Card.Content
CardCover
→Card.Cover
DialogActions
→Dialog.Actions
DialogContent
→Dialog.Content
DialogScrollArea
→Dialog.ScrollArea
DialogTitle
→Dialog.Title
DrawerItem
→Drawer.Item
DrawerSection
→Drawer.Section
FABGroup
→FAB.Group
ListAccordion
→List.Accordion
ListItem
→List.Item
ListSection
→List.Section
RadioButtonGroup
→RadioButton.Group
Paper
→Surface
SearchBar
→Searchbar
It will wrap in Portal components that are no longer wrapped in Portal by default.
It will remove color prop from DrawerItem component and set the proper color via theme prop.
Read the contribution guidelines before contributing.