locked
Remove typescript from node react project RRS feed

Answers

  • User-474980206 posted

    you need a transpilar for the jsx code. the sample uses typescript (which added .jsx support). if you don't want to use typescript, you need to pick a different transpiler. the most common one in the react community is babel. to use react modules you will need a bundler. again the most common is webpack.

    if you want to config webpack/babel yourself see:

       https://www.valentinog.com/blog/react-webpack-babel/

    a more common approach for a beginner is to use the react create scripts. install a current LTS version of node, then:

    npx create-react-app my-app
    cd my-app
    npm start
    

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 5, 2018 4:29 PM