-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: add undefined type option #1026
base: main
Are you sure you want to change the base?
Conversation
Example: from deephaven import ui
@ui.component
def nullish_calendar():
return ui.flex(
ui.calendar(value=ui.types.Undefined),
ui.calendar(value=None),
)
calendar_test = nullish_calendar()
|
Co-authored-by: Mike Bender <[email protected]>
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.
Code changes look good to me. I like how this approach simplifies things. Left 1 comment to update comment block with new _nullable_props
arg. Also would be good to put something about this in the UI docs.
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.
@wusteven815 as @bmingles suggested let's add a couple docs for this as well.
- An example to
picker.md
showing the use ofNone
vsUndefined
- A subsection in
architecture.md
components, named "Props" where we detail how we're mapping React JS props to Python args in general (children are mapped to positional args, other props are mapped to keyword args, along with a couple small examples), then a subsection within that for "Handlingnull
vs.undefined
" and detail how the issue (JS hasnull
/undefined
, some components require that differentiation, Python only hasNone
), and how we're addressing it.
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.
Suggested changes for controlled vs uncontrolled description / examples.
Co-authored-by: Brian Ingles <[email protected]>
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
Co-authored-by: margaretkennedy <[email protected]>
null
fromundefined
#549Undefined
object for nullable props_nullable_props
passed tocomponent_element
/BaseElement
None
will be translated tonull
andUndefined
will not exist in the props object