charitha venkat
charitha venkat

Reputation: 49

× TypeError: Cannot set property 'props' of undefined

function Component(props, context, updater) {

236 | this.props = props; 237 | this.context = context; 238 | this.refs = emptyObject; 239 | // We initialize the default updater but the real one gets injected by the

name.js

| import React,{Component}from 'react';
  2 | 
> 3 | class Name extends Component(){
  4 |     render(){
  5 |         return(
  6 |             <div> hello world</div>`

Upvotes: 1

Views: 2167

Answers (1)

lankovova
lankovova

Reputation: 1426

You have some sort of typo there. Try to remove parenthesis after Component, like this:

class Name extends Component {
  // ...
}

Upvotes: 4

Related Questions