mihaip / react-closure-compiler

Tooling to teach Closure Compiler about React
Apache License 2.0
100 stars 14 forks source link

Add support for object spread for props #31

Closed arv closed 5 years ago

arv commented 5 years ago

If the input code looks like:

React.createElement(Comp, {a: 1, ...b})

We rewrite that as

React.createElement(Comp, Object.assign({a: 1}, b))

and then we use the same strategy as before (wrapping the arguments of Object.assign in function calls that causes the type checker to work).

arv commented 5 years ago

PTAL

The current version now works in Quip