To make use of a prop, passed in or down from a parent component. You first created a constructor for the class. Check the code below:
class SomeClass extends Component {
Constructor(props) {
super(props);
this.props = props;
}
someMethod = () => {
console.log(this.props)
}
}
Weird! Thought it will happen some other way.
Top comments (1)
Hi Oyeyipo.
Which part would you find weird & unintuitve?