Skip to content

How to properly use children in Reacton component #18

Answered by maartenbreddels
egormkn asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Egor,

nice to see you dove into the code :)

using display also works in reacton and solara:

import reacton
import reacton.ipywidgets as w


@reacton.component
def Wrapper(children):
    with w.HBox() as wrapper:
        w.HTML(value="A")
        display(*children)
        w.HTML(value="C")
    return wrapper


@reacton.component
def Example():
    with Wrapper() as wrapper:
        w.HTML(value="B")
        w.HTML(value="B+")
    return wrapper

Is this what you needed?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@egormkn
Comment options

Answer selected by egormkn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants