Skip to content

Commit bcac2e5

Browse files
committed
[Doc] Add a migration section in <DataTable> that shows the codemod [no ci]
1 parent f4460f2 commit bcac2e5

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/DataTable.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,3 +1815,29 @@ const ReviewList = () => (
18151815
);
18161816
```
18171817

1818+
1819+
## Migrating From `<DataGrid>` To `<DataTable>`
1820+
1821+
To help you migrate from `<DataGrid>` to `<DataTable>`, we've created a codemod.
1822+
1823+
> **DISCLAIMER**
1824+
> Please review the generated changes thoroughly!
1825+
>
1826+
> Applying the codemod might break your code formatting, so don't forget to your formatter (prettier, eslint, biome, etc.) after you've applied the codemod!
1827+
1828+
For `.js` or `.jsx` files:
1829+
1830+
```sh
1831+
npx jscodeshift ./path/to/src/ \
1832+
--extensions=js,jsx \
1833+
--transform=./node_modules/ra-core/codemods/replace-Admin-history.ts
1834+
```
1835+
1836+
For `.ts` or `.tsx` files:
1837+
1838+
```sh
1839+
npx jscodeshift ./path/to/src/ \
1840+
--extensions=ts,tsx \
1841+
--parser=tsx \
1842+
--transform=./node_modules/ra-core/codemods/replace-Admin-history.ts
1843+
```

0 commit comments

Comments
 (0)