Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

what is super(props) in react

class MyComponent extends React.Component {
  constructor() {
    console.log(this); // Reference Error i.e return undefined
  }

  render() {
    return <div>Hello {this.props.name}</div>;
  }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #react
ADD COMMENT
Topic
Name
8+3 =