The project requires react, so I followed the official website and Ruan Yifeng’s tutorials to learn
The code is as shown:
The following is a reference to react, which is from The three files copied directly from Ruan Yifeng's demo
The following is the error reported to super after running. Is this because there is something missing in the referenced file?
Because you didn’t pass any props, the props are undefined, so super() should be used here.
One less babel, class xxx extends React is written in es6 and needs to be escaped.
You can download it and quote it locally.
The correct answer upstairs, super() will not report an error if it does not take the props parameter
For those of you who don’t read in English 0_0
Don’t this error mean super undefined? Who is super? Component constructor wow
Look at the poster using
React.component
instead ofReact.Component