我一直收到此语法错误,但不知道结尾序列在哪里失败:
import React, { Component } from 'react';
import './App.css';
class App extends Component {
render() {
return (
<div className="App">
<textarea rows="4" cols="50">
<h1>Look at this!</h1>
<h2>This is MAGIC!</h2>
<a href="https://www.mozilla.com/">
<p>Think about all this power of <code>React</code></p>
<textarea />
</div>
);
}
}
export default App;
答案 0 :(得分:1)
<a>
元素未关闭。我建议您添加短绒,这将使您更容易发现这些错误,也奇怪为什么您的编辑没有指出这一点。
答案 1 :(得分:0)
您的代码中有两个未终止的JSX内容。一个用于第一个textarea
,另一个用于a
。这是固定代码。顺便说一句,我同意棉绒的建议。
class App extends React.Component {
render() {
return (
<div className="App">
<textarea rows="4" cols="50" />
<h1>Look at this!</h1>
<h2>This is MAGIC!</h2>
<a href="https://www.mozilla.com/">Go to Mozilla</a>
<p>
Think about all this power of <code>React</code>
</p>
<textarea />
</div>
);
}
}
ReactDOM.render( <App />, document.getElementById( "root" ) );
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"></script>
<div id="root"></div>
答案 2 :(得分:0)
html Invalid element(s) received for the 'size' property of scattergl.marker
Invalid elements include: [nan, nan, nan, nan, nan, nan, nan, nan, nan, nan]
The 'size' property is a number and may be specified as:
- An int or float in the interval [0, inf]
- A tuple, list, or one-dimensional numpy array of the above
标签需要使用 <a>
关闭,如果有文本、div 等任何内容。
</a>