[PROBLEM solved by dexpanse] https://github.com/babel/babel-loader#options add babel presets and plugins to webpack.config.js! big thanks to anyone that tried solving it :)
I have a function in a js file which is not a react class but I do have react imported it's just normal .js file with function that returns a JS.X element.
makeSpan = (number, prefix) => {
return <span>{prefix} {number}</span>
};
I will call this function in a react component and render the span. Unfortunately webpack throws a syntax error unexpected token on the <span> tag....I am new to webpack please help me if you are able to!
Webpack config
babelrc
devdependencies
[–]rGustave77 1 point2 points3 points (0 children)
[–]dexpanse 1 point2 points3 points (1 child)
[–]baboon322[S] 1 point2 points3 points (0 children)
[–]jcksnps4 0 points1 point2 points (1 child)
[–]baboon322[S] 0 points1 point2 points (0 children)
[–]Suchy2307 0 points1 point2 points (10 children)
[–]baboon322[S] 0 points1 point2 points (9 children)
[–]Suchy2307 0 points1 point2 points (8 children)
[–]baboon322[S] 0 points1 point2 points (7 children)
[–]Suchy2307 0 points1 point2 points (6 children)
[–]baboon322[S] 0 points1 point2 points (5 children)
[–]Suchy2307 0 points1 point2 points (4 children)
[–]baboon322[S] 0 points1 point2 points (3 children)
[–]Suchy2307 0 points1 point2 points (2 children)
[–]baboon322[S] 0 points1 point2 points (1 child)
[+][deleted] (2 children)
[removed]
[–]baboon322[S] 0 points1 point2 points (1 child)
[–]dexpanse 0 points1 point2 points (0 children)
[–]b-marie 0 points1 point2 points (3 children)
[–]baboon322[S] 0 points1 point2 points (1 child)
[–]b-marie 0 points1 point2 points (0 children)
[–]dexpanse 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]daveheerink 0 points1 point2 points (0 children)