I have an easy repro here: http://jsfiddle.net/pvbvj23o/
Interesting. Debugger shows it's attached to the parentNode from <App>, but <App> hasn't yet been appended to the DOM itself. I'd love to avoid deferring componentDidMount(), since that would cost a traversal during render, but that might be the only way. Are you sure React only calls this hook once the whole tree is mounted?
Maybe just a straight up queue would be okay here. It only happens at the root (because render() is special-cased).
Looks like React only calls the hook once the element is mounted: https://jsfiddle.net/x6xpdkjL/
The docs seem to confirm: https://facebook.github.io/react/docs/component-specs.html#mounting-componentdidmount
Awesome, thanks for investigating. I'll try to look into this tonight. I have confirmed the bug is still present in 4.0.1.
Still present in 4.5.
Yup, on my to-do list. thx.
Hooray!! 馃憦 馃帀 馃嵒
Released in 5.2.0-beta.0.
Most helpful comment
Yup, on my to-do list. thx.