Last active
August 25, 2021 11:08
-
-
Save Hydrock/35404178df2bd13de7cfd946c1883409 to your computer and use it in GitHub Desktop.
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
// Old | |
ReactDOM.render(<App />, container, () => console.log("renderered")); | |
// New | |
const App = ({ callback }) => { | |
return ( | |
<div ref={callback}> | |
<h1>Hello World</h1> | |
</div> | |
); | |
} | |
const root = ReactDOM.createRoot(container); | |
root.render(<App callback={() => console.log("renderered")} />); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment