Javascript ×;TypeError:无法设置属性';道具';未定义的
功能组件(道具、上下文、更新程序){ 236 | this.props=道具; 237 | this.context=context; 238 | this.refs=清空对象; 239 |//我们初始化了默认的更新程序,但实际的更新程序被 name.jsJavascript ×;TypeError:无法设置属性';道具';未定义的,javascript,reactjs,Javascript,Reactjs,功能组件(道具、上下文、更新程序){ 236 | this.props=道具; 237 | this.context=context; 238 | this.refs=清空对象; 239 |//我们初始化了默认的更新程序,但实际的更新程序被 name.js | import React,{Component}from 'react'; 2 | > 3 | class Name extends Component(){ 4 | render(){ 5 |
| import React,{Component}from 'react';
2 |
> 3 | class Name extends Component(){
4 | render(){
5 | return(
6 | <div> hello world</div>`
|从'React'导入React,{Component};
2 |
>3 |类名扩展组件(){
4 | render(){
5 |返回(
6 |你好,世界`
您有一些打字错误。请尝试删除组件后的括号,如下所示:
class Name extends Component {
// ...
}
您有一些打字错误。请尝试删除组件
后面的括号,如下所示:
class Name extends Component {
// ...
}
类名扩展组件{
欢迎来到stackoverflow charitha!很难理解您的问题。请阅读。请格式化或表示好代码和问题!类名扩展组件{
欢迎来到stackoverflow charitha!很难理解您的问题。请阅读。请格式化或表达好代码和问题!