Skip to content

Allow Children with the Same Key to Vary in Type #613

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

Closed
rmorshea opened this issue Jan 25, 2022 · 0 comments · Fixed by #614
Closed

Allow Children with the Same Key to Vary in Type #613

rmorshea opened this issue Jan 25, 2022 · 0 comments · Fixed by #614
Labels
priority-2-moderate Should be resolved on a reasonable timeline.
Milestone

Comments

@rmorshea
Copy link
Collaborator

Current Situation

Right now, if an element starts out as a component, it can't be converted to a component later. For example,

from idom import component, html

@component
def First():
    if condition:
        return html.div()
    else:
        return Second()

@component
def Second():
    ...

This will result in either of the following errors:

Initially I introduced those errors because I imagined that this scenario would be uncommon or that if it did one would want to avoid changing from a standard element to a component. The simplicity of the case above though demonstrates how common and useful this case might be.

Proposed Actions

All the above described usage. The logic inside the layout is getting complex enough that it may warrant refactoring at some point to make it easier to understand. Right now there's a lot of mutation that goes on which is hard to follow.

Work Items

No response

@rmorshea rmorshea added flag-triage Not prioritized. priority-2-moderate Should be resolved on a reasonable timeline. type: feature and removed flag-triage Not prioritized. labels Jan 25, 2022
@rmorshea rmorshea added this to the 1.0 milestone Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-2-moderate Should be resolved on a reasonable timeline.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant