Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

I got the error unclosed regular expression in my jsfiddle

Writer Matthew Barrera

I am new to React and jsfiddle. I try to program something basic in React by the JSfiddle but nothing appear on the screen and I get the errors "unclosed regular expression" and "Unrecoverable syntax error". I didnt find any solution or explanation, why these errors appear, not in the web and here. The following is the my jsfiddle: Can you please tell me what i am missing. The following is the code:

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="">
</head>
<body> <div> <div> </div> </div>
</body>
</html>

1 Answer

Bad synthaxe, you can't write

return();

And you can't return nothing. Try to use the message outputed by the console to figure out what is wrong before asking :) In chrome, right click anywhere => inspect => console tab

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy