Skip to content

checkComponentValidity in custom ReactComponent no longer affects form validity after upgrading to 6.x #621

@khalilkhalil25

Description

@khalilkhalil25

I'm creating a custom component that extends ReactComponent, and I'm implementing custom validation logic by overriding the checkComponentValidity method. This approach worked as expected in version 5.3.0.

After upgrading to 6.0.1, checkComponentValidity() is still called, but its return value no longer seems to affect the form’s validity. Even when the method returns false, the form still submits and reports as valid.

Expected Behavior:
When checkComponentValidity() returns false, the form should be considered invalid.

Actual Behavior:
The method is called, but the form is valid regardless of its return value.

Steps to Reproduce:
Extend ReactComponent

Override checkComponentValidity() to return false

Render the component in a form

Observe that the form still submits without error

Please let me know if this behavior was changed intentionally, and if so, what the correct way to implement custom component-level validation is in v6+.

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