entropic616
entropic616

Reputation: 101

SyntaxError: super() is only valid in derived class constructors

I'm pretty new to React, so I'm having an issue with the main class I'm trying to setup. I thought that when you setup a constructor that you need to setup super() to be able to use 'this'. However, I get this error: "SyntaxError: super() is only valid in derived class constructors". I am unable to find anyone else having this issue. The class in question is below.

class TheClassName extends React.Component {

   contructor(props) {

   super(props);

   this.state = {stuff: Array(10).fill(null), stufftwo: false, stuffthree: 'Stuff'};

}


}

Upvotes: 5

Views: 3070

Answers (1)

0xnoob
0xnoob

Reputation: 1037

You forgot the s in constructor. :-)

Upvotes: 10

Related Questions