Skip to content
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

[REF-2524]Tuple unpacking should apply at component level #3062

Merged
merged 8 commits into from Apr 11, 2024

Conversation

ElijahAhianyo
Copy link
Collaborator

@ElijahAhianyo ElijahAhianyo commented Apr 10, 2024

The code below should work now:

def index() -> rx.Component:
    random_text = rx.text("some text here"),
    return rx.center(
        random_text
    )
    

Also the code below will be unwrapped in a fragment: as well

def index() -> rx.Component:
    comp = (rx.text("some text here"), rx.text("another text"))
    return rx.center(
        comp
    )

Equivalent to below:

def index() -> rx.Component:
    return rx.center(
        rx.fragment(
             rx.text("some text here"), 
            rx.text("another text")
       ),
    )

Copy link

linear bot commented Apr 10, 2024

@ElijahAhianyo ElijahAhianyo marked this pull request as ready for review April 10, 2024 13:51
Copy link
Contributor

@picklelo picklelo left a comment

Choose a reason for hiding this comment

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

awesome

@picklelo picklelo merged commit 04ab2b9 into main Apr 11, 2024
46 checks passed
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.

None yet

3 participants