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

spread syntax on jsx properties no longer works (RN0.30) #8787

Closed
mschipperheyn opened this issue Jul 14, 2016 · 3 comments
Closed

spread syntax on jsx properties no longer works (RN0.30) #8787

mschipperheyn opened this issue Jul 14, 2016 · 3 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@mschipperheyn
Copy link

mschipperheyn commented Jul 14, 2016

After upgrading to RN0.29 and RN0.30 I started getting this unhelpful exception:

'One of the sources for assign has an enumerable key on the prototype chain'

I traced this back to the use of spread syntax in jsx component calls. The error would go away if I specified the individual attributes explicitly. Props in this case is a regular object supplied through an enclosing method (not a jsx this.props)

<RouteScreen
      {...props}
      pathVariables={pathVariables}

I'm not sure why this suddenly stopped working. Only seems to happen in some cases. Any suggestions?

@ide
Copy link
Contributor

ide commented Jul 14, 2016

The spread syntax hasn't broken AFAIK. Have you looked at your props object to see why it has a prototype?

@mschipperheyn
Copy link
Author

No, I never actually understood the exception just that it worked before and didn't anymore,but thanks for the suggestion. It might be related to changes that have been made in ReactNative Experimental which was changed significantly between the versions I upgraded and is the primary content for the object where I'm running into the exception.

@mkonicek
Copy link
Contributor

Hi there! This issue is being closed because it has been inactive for a while.

But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/spread-syntax-on-jsx-properties-no-longer-works-rn030

Product Pains has been very useful in highlighting the top bugs and feature requests:
https://productpains.com/product/react-native?tab=top

Also, if this issue is a bug, please consider sending a pull request with a fix.

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants