i am trying run my react application using npm start commamnd and installed both @babel/preset-react and @babel/plugin-syntax-jsx. but i am running this react application getting following error.
Support for the experimental syntax 'jsx' isn't currently enabled (7:9):
6 | const PostCodeLookup = props => {
> 7 | return <PostcodeLookup {...props} />
| ^
8 |
9 | };
Add @babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel config to enable transformation. If you want to leave it as-is, add @babel/plugin-syntax-jsx (https://git.io/vb4yA) to the 'plugins' section to enable parsing.
.babelrc
orbabel.config.js(on)
file with these contents, just installing the packages won't work.Putting an example below for how your
babel.config.json
should look like. Please remove any extra plugins from below example in case you use it.