mirror of
https://github.com/gre/gl-react.git
synced 2026-01-25 16:43:36 +00:00
fix(gl-react): prefer to _addGLNodeChild in DidMount
NB I need to test that more deeply. this is to fix that React16 seem have different willMount/unmount ordering & the Surface#_addGLNodeChild now starts to trigger the 'one child at a time' invariant for a normal "switch", probably because newChild._addGLNodeChild is called before oldChild._removeGLNodeChild
This commit is contained in:
parent
97dc545dcc
commit
aaace75a15
@ -419,12 +419,12 @@ export default class Node extends Component {
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { glParent, glSurface: { gl } } = this.context;
|
||||
const { glSurface: { gl } } = this.context;
|
||||
if (gl) this._prepareGLObjects(gl);
|
||||
glParent._addGLNodeChild(this);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.context.glParent._addGLNodeChild(this);
|
||||
this.redraw();
|
||||
if (this.props.sync) this.flush();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user