Skip to content

Danger setValue #114

Description

@nechutny

Hello,

before some time I've been fixing a bug in our project which was caused by using setValue on input instead of setDefaultValue, so typed value by user was overwritten. After investigation I've found same bug across our projects and made by a lot of different developers.
This moved me to think about setValue method which is confusing. Is there any use-case, when it can't be protected? I think, that it's only used in creating custom inputs and then protected or at least @internal annotation should help with eliminating this mistake. Custom inputs are extending input so protected is ok.
In my opinion is this more confusing, than eg. method callbacks so we should think about it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions