Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(antd): fix antd/next render error at React 19 #4262

Merged

Conversation

charlzyx
Copy link
Contributor

@charlzyx charlzyx commented Jan 16, 2025

React 19 环境下, Form 组件 component 无法获取到 form (因为 function 组件的 defaultProps 属性被废弃), 造成渲染失败

#4254

Before submitting a pull request, please make sure the following is done...

  • Ensure the pull request title and commit message follow the Commit Specific in English.
  • Fork the repo and create your branch from master or formily_next.
  • If you've added code that should be tested, add tests!
  • If you've changed APIs, update the documentation.
  • Ensure the test suite passes (npm test).
  • Make sure your code lints (npm run lint) - we've done our best to make sure these rules match our internal linting guidelines.

Please do not delete the above content


What have you changed?

修复在 React 19 环境中 defaultProps 失效问题, 这是 19 的一个 BreakChange, 将 defaultProps 替换为ES6 参数默认赋值;

React 19 Upgrade Guide Removed: propTypes and defaultProps for functions

https://codesandbox.io/p/sandbox/tgnf4j

Form 组件 component 无法获取到 form, 造成渲染失败
@charlzyx charlzyx changed the title fix(antd,next): 🩹 replace defaultProps by default parameters fix(antd/next): fix <Form> render error at React 19 Jan 16, 2025
@charlzyx charlzyx changed the title fix(antd/next): fix <Form> render error at React 19 fix(antd): fix antd/next render error at React 19 Jan 16, 2025
@janryWang janryWang merged commit a0f3169 into alibaba:formily_next Jan 21, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants