This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fiberRoot.current.stateNode === fiberRoot; // true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const hostRootFiberNode = fiberRoot.current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fiberRoot = query('#container')._reactRootContainer._internalRoot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const domContainer = document.querySelector('#container'); | |
| ReactDOM.render(React.createElement(ClickCounter), domContainer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function updateHostComponent(current, workInProgress, renderExpirationTime) {...} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| $$typeof: Symbol(react.element), | |
| key: null, | |
| props: {}, | |
| ref: null, | |
| type: ClickCounter | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| $$typeof: Symbol(react.element), | |
| type: 'button', | |
| key: "1", | |
| props: { | |
| children: 'Update counter', | |
| onClick: () => { ... } | |
| } | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ClickCounter { | |
| ... | |
| render() { | |
| return [ | |
| React.createElement( | |
| 'button', | |
| { | |
| key: '1', | |
| onClick: this.onClick | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <button key="1" onClick={this.onClick}>Update counter</button> | |
| <span key="2">{this.state.count}</span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ClickCounter extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = {count: 0}; | |
| this.handleClick = this.handleClick.bind(this); | |
| } | |
| handleClick() { | |
| this.setState((state) => { | |
| return {count: state.count + 1}; |