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

Render children without a wrapping element #122

Closed
bryceosterhaus opened this issue Jun 7, 2016 · 2 comments
Closed

Render children without a wrapping element #122

bryceosterhaus opened this issue Jun 7, 2016 · 2 comments

Comments

@bryceosterhaus
Copy link
Member

Trying to replicate a similar component to https://github.com/facebook/react/blob/master/src/addons/transitions/ReactCSSTransitionGroupChild.js#L167

I would expect this to work like...

class Parent extends JSXComponent {
    rendered() {
        this.element.className = 'test';
    }

    render() {
        return this.children[0];
    }
}

class Child extends JSXComponent {
    render() {
        return (
            <div>
                I'm a child!
            </div>
        );
    }
}


// Implementation

<Parent>
    <Child />
</Parent>


// Expected Markup Result

<div class="test">
    I'm a child!
</div>

Is this possible? Or are there reasons why we shouldn't have this be possible?

@mthadley
Copy link

mthadley commented Jun 7, 2016

@bryceosterhaus I think it might already work this way: mairatma/metal-jsx@cea04a8#diff-60cffaf471498fafe64649ed28d9abb3R163

@bryceosterhaus
Copy link
Member Author

You're totally right, I didn't see that update. Thanks!

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

No branches or pull requests

2 participants