GithubHelp home page GithubHelp logo

Comments (4)

zombieJ avatar zombieJ commented on May 7, 2024

initialValues 是 FormData 的子集,不是等价关系。Form 本身就支持泛型,你应该通过泛型来填充:

interface FormData {}

<Form<FormData> />

from ant-design.

rookie-luochao avatar rookie-luochao commented on May 7, 2024

问题是antd里面需要手动填充泛型的地方太多,我也是看到有其他的form库是支持自动推导的,而不一定必须泛型填充

from ant-design.

afc163 avatar afc163 commented on May 7, 2024

@rookie-luochao 不确定能不能推导出来,来试试给个 PR?

from ant-design.

crazyair avatar crazyair commented on May 7, 2024

首先,initialValues 使用泛型

image

这里 values 还是 any 类型

image

是因为 form={form} 干扰的,需要注释掉,或者 useForm 也设置类型。使用上还是有点麻烦,不如直接 <Form<xxx>

from ant-design.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.