react-codemod
react-codemod copied to clipboard
React codemod scripts
The example nicely shows that default props from `defaultProps` will be added to the component props as shown in this example https://github.com/codemod-com/codemod/tree/main/packages/codemods/react/19/replace-default-props. However, when I am running `npx codemod react/19/replace-default-props`...
## current behaviour files that include React runtime code, like `React.useState`, are properly handled by the code-mod. However, as soon as there is a single type import from React, like...
All TypeScript files that use `satisfies` - a rather new TS keyword - fail parsing with: ``` Error: did not recognize object of type "TSSatisfiesExpression" ``` for us, that's 375...
#### 📚 Description This PR is created to update the react-codemod repository with the updates for the react/19/replace-default-props codemod and to align the open-source content of this codemod in react-codemod...
#### 📚 Description This PR fixes TypeScript errors related to `require.requireActual` in multiple transform tests. The issue was originally discussed in [reactjs/react-codemod#332](https://github.com/reactjs/react-codemod/issues/332). 1. **Fixed `remove-context-provider` transform test** 2. **Fixed `remove-forward-ref`...
#### 📚 Description This PR introduces the new `prop-types-typescript` transform. 1. **New Transform: Prop Types to TypeScript** - Added `prop-types-typescript` transform to assist in migrating from `prop-types` to TypeScript interfaces....
### 🐛 Bug Report #### **Description** When running tests using `npm run test`, the following TypeScript error occurs in some of the tests: ``` Property 'requireActual' does not exist on...
```bash $ npx codemod react/19/remove-context-provider --target ./ Error: ָ���ĵ�¼�Ự�����ڡ������ѱ���ֹ�� Codemod CLI uses "keytar" to store your credentials securely. Please make sure you have "libsecret" installed on your system. Depending on...
While running the command `npx codemod react/rename-unsafe-lifecycles --target ` I'm getting the following response Even though this solution _Originally posted by @parthakshay in https://github.com/reactjs/react-codemod/issues/254#issuecomment-1099067963_ works, either the command given in...
Hi, Running this command ``` codemod react/create-element-to-jsx --target ./src ``` I get this error: ``` The specified command or codemod name could not be recognized. ... ``` I searched the...