advanced-react-webpack-babel-setup icon indicating copy to clipboard operation
advanced-react-webpack-babel-setup copied to clipboard

JSX

Open mybigopenbox opened this issue 5 years ago • 0 comments

Great template, however the babel doesn't seem to support JSX as ReactJS is a bigger user

ERROR in ./src/contexts/AuthProvider/AuthProvider.js Module build failed (from ./node_modules/babel-loader/lib/index.js): SyntaxError: advanced-react-webpack-babel-setup/src/contexts/AuthProvider/AuthProvider.js: Support for the experimental syntax 'jsx' isn't currently enabled (21:9):

19 | 20 | return (

21 | <AuthContext.Provider value={{state, setState}}> | ^ 22 | {children} 23 | </AuthContext.Provider> 24 | )

Add @babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel config to enable transformation.

mybigopenbox avatar Nov 04 '20 21:11 mybigopenbox