Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"[ts] Unterminated regular expression literal."

I'm getting this error in an almost empty react component:

"[ts] Unterminated regular expression literal."

import * as React from 'react';  export default class EmptyComponent extends React.Component {      render() {          return (             <p>Hello</p>         );     } } 

I don't know what I'm doing wrong!

like image 672
JulianG Avatar asked Dec 01 '17 21:12

JulianG


1 Answers

It turns out I was using the .ts file extension instead of .tsx

Make sure your component file extension is .tsx (if you're using Typescript) or .jsx (if you're using Javascript).

like image 56
JulianG Avatar answered Sep 28 '22 13:09

JulianG