Do I really need Babel or other transpilers to use ES6 with React?

后端 未结 3 1489
猫巷女王i
猫巷女王i 2020-12-16 10:48

Do I really need Babel or other transpilers to use ES6 in React?

I was looking at the chart https://kangax.github.io/compat-table/es6/

Seems like my current

3条回答
  •  自闭症患者
    2020-12-16 11:13

    If you want to:

    • use modules (with require() or import ...)
    • use JSX
    • support a lot of browsers
    • use more advanced features (async/await), some still in proposals (decorators, class properties..)

    You must use Babel to be sure that everyone will be able to run your code, else you can develop without it.

提交回复
热议问题