Prop Drilling - Passing the props from parent to Child or nested child for multiple components is props drilling
Coding Example :
It will initiate the parent's constructor method and allows the component to inherit methods from its parent (React.Component).
e.g.
class Header extends React.Component {
constructor(props) {
super(props);
this.state = {favoritecolor: "red"};
}
}
No comments:
Post a Comment