Closed rstacruz closed 8 years ago
Just added tests for this and they're passing. Published 2.0.0-rc6
.
I'm still getting issues of context
being undefined. I'll see if i can make a reduced test case
Okay, it only happens on the second render.
const MyComponent = {
render ({ context }) {
console.log('level 2 render:', context)
return <div>hello</div>
}
}
const AppRoot = {
render ({ context }) {
console.log('level 1 render:', context)
return <div class='app'>
<MyComponent />
</div>
}
}
Render it twice:
let render = dom.createRenderer(document.body)
// Render twice
render(<AppRoot />, { isContext: true })
render(<AppRoot />, { isContext: true })
level 1 render: { isContext: true }
level 2 render: { isContext: true }
level 1 render: { isContext: true }
level 2 render: undefined :(
Given these two components that nest each other, I'm expecting
context
to travel down toButton
.But in actuality, only form sees it:
If you change
Form.render
to remove the wrappingdiv.actions
, it works: