Skip to content

Best practice to manipulate a field's value #152

@mohebifar

Description

@mohebifar

Assume that I need to change the value of username input field upon the change of last name field. The reason why the username should be kept on the input is to let the user manipulating it. The way to do it is to call the change action to change the value of username input. But we need to override the onChange prop on lastName input. It seems sloppy and I wonder if it has drawbacks.

<input {...lastName} />
<input {...username} />

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