Skip to content

uses ReactIs.isValidElementType to check widget types#1737

Closed
jonathanhawleypeters wants to merge 1 commit intorjsf-team:masterfrom
jonathanhawleypeters:1209-valid-element-type
Closed

uses ReactIs.isValidElementType to check widget types#1737
jonathanhawleypeters wants to merge 1 commit intorjsf-team:masterfrom
jonathanhawleypeters:1209-valid-element-type

Conversation

@jonathanhawleypeters
Copy link

Reasons for making this change

Since React 16.3.0 components created by React.forwardRef may be an object. According to the guidelines, react-is should be used for type validation.

#1209

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests
    • I've updated docs if needed
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

rjsf-team/react-json-schema-form#1209
@epicfaace epicfaace marked this pull request as ready for review May 1, 2020 13:17
ReactIs.isMemo(widget)
) {
if (typeof widget !== "string" && ReactIs.isValidElementType(widget)) {
return mergeOptions(widget);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since our old tests didn't catch this issue, would it be possible to update them so that we don't regress again?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'll do that soon. Thanks for the reminder

@stale
Copy link

stale bot commented May 18, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please leave a comment if this is still an issue for you. Thank you.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants