JSX Spread Attributes on client side non-ES6 browsers

前端 未结 2 1648
死守一世寂寞
死守一世寂寞 2021-01-16 15:43

ReactJS JSX has a method for easily adding lots of properties to a component:

var props = {};
props.foo = x;
props.bar = y;
var component = 

        
2条回答
  •  忘掉有多难
    2021-01-16 16:26

    The usual workflow of ReactJS would be transforming the JSX via Babel (by a build tool like Browserify/Webpack) before serving it to the client. Hence you get all the ES6 (or ESNext) goodies.

    Getting Started | React

提交回复
热议问题