import React from 'react';
class App extends Component{
constructor(props){
super(props);
this.state={
}
}
}
直接继承Component会失败,是因为没有引入{Component}
这样引入就可以了
import React,{Component} from 'react';
import React from 'react';
class App extends Component{
constructor(props){
super(props);
this.state={
}
}
}
直接继承Component会失败,是因为没有引入{Component}
这样引入就可以了
import React,{Component} from 'react';