我是一个Angular开发者,对React还不熟悉,这是一个简单的React组件,但是不起作用。
import react, { Component } from 'react';
import { render } from 'react-dom';
class TechView extends Component {
constructor(props){
super(props);
this.state = {
name:'Gopinath'
}
}
render(){
return(
hello Tech View
);
}
}
export default TechView;
错误: 在使用JSX时,'React'必须在作用域内 react/react-in-jsx-scope
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
导入行应该是:
import React, { Component } from 'react';注意React的大写R。