The process of upgrading Ant Design 3.x to 4.0

1. Execute npm i -g @ant-design/codemod-v4 global installation
2. This is the code will be changed, git status to view the code status
insert image description here
3. git commit local merge
4. antd4-codemod src (will put all your current components If it does not support antd4.0, it will automatically change to support antd4.0
. If an error is reported in the middle, it can be modified according to the error, and then run antd4-codemod src, and it will prompt no error after repeated operations.) After the first execution , there are five places that need to be manually
executed
insert image description here
Modified, follow to modify
5. Install compatible npm i @ant-design/compatible
6. Then follow the prompts to modify the version in package.json
7. git add. Add git commit to merge locally
8. Continue to execute antd4-codemod src
execution results , shows that the check is passed, indicating that the upgrade is complete
insert image description here
9. Run npm run start to write the code of version 4.0

Guess you like

Origin blog.csdn.net/m0_49016709/article/details/125045824