Skip to content

[enhancement] Bind the this context to the methods on FormState and FieldState #27

Open
@yinxulai

Description

@yinxulai

First. i want reduce communication costs. so, then i use Chinese describe this issue.

因为并不是所有的 FormState 使用场景中消费者都是标准的 Form 组件,所以不一定有、且不一定需要有对应的 bindXX 方法,就会碰到下面的问题:

const anyState = new FieldState<any>()
...
<AnyComponent onAnyDateChange={anyState.onChange}>
...

当前的实现中,未对 FormState and FieldState 上面的方法绑定 this 上下文,从而当如上使用时,会发生错误.

例如这些地方:

我们是否应该为这些方法绑定所在的 this 上下文?

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionMore discussions requiredquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions