-
Notifications
You must be signed in to change notification settings - Fork 45
export useChoices and other utilities for elements #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
export useChoices and other utilities for elements #241
Conversation
chohmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for a probably rogue console.log statement.
| // eslint-disable-next-line no-console | ||
| console.log({ childNodes }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for catching that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed in 2bf4e4a
mallachari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and naming should be fine
| const childNodes = React.useMemo(() => calculateChildrenToShow(selectedChoice.type), [selectedChoice.type]); | ||
| const childNodes = React.useMemo(() => visibleChildren(selectedChoice.type), [selectedChoice.type]); | ||
| // eslint-disable-next-line no-console | ||
| console.log({ childNodes }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| console.log({ childNodes }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you both for catching that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed in 2bf4e4a
|
🎉 This PR is included in version 4.13.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Motivation and Context
https://github.com/stoplightio/platform-internal/issues/18370
json-schema-viewer and TryIt have been using different logic to determine if/how to display form-encoded schemas that have a
oneOfcombiner at the top level.Description
Expose a few utility features for use by related, downstream tools that also render JSON Schema in one way or another.
Specifically, the TryIt function of Elements will be able to reuse the same logic -- and thereby get the same visible results -- as json-schema-viewer.
How Has This Been Tested?
Existing functionality is being exported; no functional changes were made.
Types of changes
Checklist