Lucifier129/react-lite

React.__spread support

VinSpee opened this issue · 4 comments

Hi!

I'm using react-lite along side of react-typeahead.

It digs into React.__spread, which is just an Object.assign polyfill. Is it possible / valuable enough to add that method to react-lite?

https://github.com/facebook/react/blob/6a8ebfc41842fb200c87a919478dcd3aa95be0d7/src/isomorphic/React.js#L70

JSX spread just works well when use webpack, it seems like browserify do somethings differently in it.

Can you switch to webpack?

Or build your own react-lite like below:

// react-lite-with-spread-hook.js
var React = require('react-lite')
var assign = require('object.assign')
module.exports = assign({
  __spread: assign
}, React)

Then use alias react-lite-with-spread-hook for react/react-dom.

I am actually using require.js (w/o JSX) (soon will be migrating to webpack, but not an option quite yet). I will try shimming as you suggested, thanks!

It may be a good idea to mention that react-lite only works with a JSX toolchain?

awesome, thanks!