Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React.__spread support #51

Closed
VinSpee opened this issue Mar 29, 2016 · 4 comments
Closed

React.__spread support #51

VinSpee opened this issue Mar 29, 2016 · 4 comments

Comments

@VinSpee
Copy link

VinSpee commented Mar 29, 2016

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

@Lucifier129
Copy link
Owner

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.

@VinSpee
Copy link
Author

VinSpee commented Mar 30, 2016

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?

@Lucifier129
Copy link
Owner

That will be good, I add the notice at https://github.com/Lucifier129/react-lite#react-lite-vs-react

@VinSpee
Copy link
Author

VinSpee commented Mar 30, 2016

awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants