TypeError: Class extends Value undefined is not a constructor or null
For example, styled- Components are used to complete the Header component layout (1)
The code inside index.js looks like this when I get an error:
import React, { Compontent } from 'react';
class Header extends Compontent {
render () {
return (
<div>header</div>
)
}
};
export default Header;
Copy the code
Show the error here
Error causes and solutions:
Compontent incorrectly written, should be Component
This error also happens with lowercase Component, so make sure you write the deconstructed name correctly