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

[Bug Report] react 19无法使用formily #4254

Open
1 task
xiukun opened this issue Dec 29, 2024 · 2 comments
Open
1 task

[Bug Report] react 19无法使用formily #4254

xiukun opened this issue Dec 29, 2024 · 2 comments

Comments

@xiukun
Copy link

xiukun commented Dec 29, 2024

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

https://antd5.formilyjs.org/zh-CN/components/form 在react19版本下该示例报错

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of Form.
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of Form.

What is expected?

正常渲染运行formally

What is actually happening?

实际react报错

Package

@formily/antd-v5@2.3.2


@charlzyx
Copy link
Contributor

antd/antd-v5 适配层 该更新了, 这是 19的一个 break change

React 19 Upgrade Guide Removed: propTypes and defaultProps for functions

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

@ShenHongFei
Copy link

有一个临时的方案,可以手动传 component='form' 参数,不走那个默认的 defaultProps 逻辑,这样可以正常渲染

import { Form } from '@formily/antd-v5'

<Form component='form' ...>

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

No branches or pull requests

3 participants