我的 jsfiddle 中出现错误未关闭的正则表达式
I got the error unclosed regular expression in my jsfiddle
我是 React 和 jsfiddle 的新手。
我尝试通过 JSfiddle 在 React 中编写一些基本的程序,但屏幕上没有任何内容,我收到错误 "unclosed regular expression" 和 "Unrecoverable syntax error"。
我没有找到任何解决方案或解释,为什么会出现这些错误,而不是在网络和此处。
以下是我的jsfiddle:
https://jsfiddle.net/eli12m/or9uxwch/38/
你能告诉我我错过了什么吗?
以下是代码:
class InputPhoneNumber extends React.component{
render(){
return(
);
}
}
class ReadOnlyPhoneNumber extends React.component{
render(){
return(
);
}
}
class PhoneNumberInputDisplay extends React.component{
render(){
return (<h1>Hello World</h1>); /* Here the errors */
}
}
ReactDOM.render(
<PhoneNumberInputDisplay />,
document.getElementById('root')
);
<html>
<head>
<title>Page Title</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
</head>
<body>
<div class="jumbotron jumbotron-fluid">
<div id="root" class="container">
</div>
</div>
</body>
</html>
错误的语法,你不会写
return();
而且你不能return什么都没有。在询问之前尝试使用控制台输出的消息找出问题所在:)
在 chrome 中,右键单击任意位置 => 检查 => 控制台选项卡
我是 React 和 jsfiddle 的新手。 我尝试通过 JSfiddle 在 React 中编写一些基本的程序,但屏幕上没有任何内容,我收到错误 "unclosed regular expression" 和 "Unrecoverable syntax error"。 我没有找到任何解决方案或解释,为什么会出现这些错误,而不是在网络和此处。 以下是我的jsfiddle: https://jsfiddle.net/eli12m/or9uxwch/38/ 你能告诉我我错过了什么吗? 以下是代码:
class InputPhoneNumber extends React.component{
render(){
return(
);
}
}
class ReadOnlyPhoneNumber extends React.component{
render(){
return(
);
}
}
class PhoneNumberInputDisplay extends React.component{
render(){
return (<h1>Hello World</h1>); /* Here the errors */
}
}
ReactDOM.render(
<PhoneNumberInputDisplay />,
document.getElementById('root')
);
<html>
<head>
<title>Page Title</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
</head>
<body>
<div class="jumbotron jumbotron-fluid">
<div id="root" class="container">
</div>
</div>
</body>
</html>
错误的语法,你不会写
return();
而且你不能return什么都没有。在询问之前尝试使用控制台输出的消息找出问题所在:) 在 chrome 中,右键单击任意位置 => 检查 => 控制台选项卡