diff --git a/.changeset/popular-papayas-breathe.md b/.changeset/popular-papayas-breathe.md new file mode 100644 index 00000000000..609e8f54f24 --- /dev/null +++ b/.changeset/popular-papayas-breathe.md @@ -0,0 +1,5 @@ +--- +'polaris.shopify.com': minor +--- + +Added documentation for the `react-rename-component` codemod diff --git a/polaris.shopify.com/content/tools/polaris-migrator.md b/polaris.shopify.com/content/tools/polaris-migrator.md index 119d47010c5..df8a837caeb 100644 --- a/polaris.shopify.com/content/tools/polaris-migrator.md +++ b/polaris.shopify.com/content/tools/polaris-migrator.md @@ -691,6 +691,25 @@ npx @shopify/polaris-migrator styles-insert-stylelint-disable
+#### `react-rename-component` + +A generic codemod to rename any component and its prop type. + +```diff +- ++ +- export interface MyComponentPropType {} ++ export interface MyRenamedComponentPropType {} +``` + +
+ +```sh +npx @shopify/polaris-migrator react-rename-component --renameFrom="MyComponent" --renameTo="MyRenamedComponent" --renamePropsFrom="MyComponentPropType" --renamePropsTo="MyRenamedComponentPropType" +``` + +
+ #### `react-rename-component-prop` A generic codemod to rename any component prop.