Lucifier129 / react-lite

An implementation of React v15.x that optimizes for small script size
MIT License
1.73k stars 98 forks source link

Implement React.__spread() as extend() #53

Closed stefwalter closed 8 years ago

stefwalter commented 8 years ago

This function used by JSX compiled code regularly when transferring properties.

https://facebook.github.io/react/docs/transferring-props.html

stefwalter commented 8 years ago

Example JSX code:

                return <Event { ...itm } />;

Compiled to:

                return React.createElement(Event, React.__spread({},   itm ));
Lucifier129 commented 8 years ago

Regular React will remove React.__spread in the future, visit: https://github.com/facebook/react/pull/6444

And now we have already a solution to support React.__spread.

Thx for PR ;)