-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Component as props #1965
Component as props #1965
Conversation
652f6e5
to
eab4b27
Compare
8f4373f
to
3905100
Compare
b3f688d
to
dce32fd
Compare
components/dash-core-components/src/components/Checklist.react.js
Outdated
Show resolved
Hide resolved
# Conflicts: # dash/development/base_component.py
…andle children props.
7ad588b
to
63f7312
Compare
dash/development/base_component.py
Outdated
@@ -392,6 +402,14 @@ def __repr__(self): | |||
props_string = repr(getattr(self, "children", None)) | |||
return f"{self._type}({props_string})" | |||
|
|||
@classmethod | |||
def _get_base_nodes(cls): | |||
if not cls._base_nodes: |
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.
if a component has lots of props but none of them accept components, will we run this iteration every time one of them is instantiated? If so, can we avoid that? Moving + ["children"]
in here would be one way perhaps?
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.
oh sorry, it's only iterating over _children_props
- so the problem only comes if there are lots of nested props and no base props. Still would be best to avoid.
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.
Let's move that to the generator.
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 great! Seems like the way you implemented this is compatible with the old generated components, how hard would it be to add a test to explicitly verify that? ie include a component in the tests that doesn't auto-generate but instead uses the old generator output?
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.
Added a legacy test from the old standard component output.
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 great! Add a changelog entry and consider my minor perf comment and I think we're ready to go! 💃
100da72
to
5beab83
Compare
5beab83
to
ebc309a
Compare
Add component as prop support.
Contributor Checklist
optionals
CHANGELOG.md