TypeError: class heritage react__WEBPACK_IMPORTED_MODULE_0__.component is not an object or null
来自此代码;
import React, {component} from 'react';
import Cardlist from './Cardlist';
import SearchBox from './SearchBox';
import {robots} from './robots';
class App extends component{
constructor () {
super()
this.state = {
robots: robots,
searchfield: ''
}
}
render(){
return (
<div className = 'tc'>
<h1>RoboFriends</h1>
<SearchBox/>
<Cardlist robots = {this.state.robots}/>
</div>
);
}
}
export default App;