Created
April 11, 2023 12:21
-
-
Save andyfaizan/8a916737eb8f00a3272253af48d4c6ff 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
// Parent.jsx | |
class Parent extends React.Component { | |
constructor() { | |
super(); | |
console.log("Parent constructor"); // 1 | |
} | |
componentDidMount() { | |
console.log("Parent CDM"); // 2 | |
} | |
render() { | |
return <Child />; | |
} | |
} | |
// Child.jsx | |
class Child extends React.Component { | |
constructor() { | |
super(); | |
console.log("Child constructor"); // 3 | |
} | |
componentDidMount() { | |
console.log("Child CDM"); // 4 | |
} | |
render() { | |
return <div />; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment