Skip to content

JSX Spread Attributes in IE-11 not working out of the box #6091

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

Closed
slaterbbx opened this issue Dec 26, 2018 · 2 comments
Closed

JSX Spread Attributes in IE-11 not working out of the box #6091

slaterbbx opened this issue Dec 26, 2018 · 2 comments

Comments

@slaterbbx
Copy link

slaterbbx commented Dec 26, 2018

Is this a bug report?

Yes I believe this is a bug, but may not be. Based on the documentation I believe so.

Did you try recovering your dependencies?

Yes I did, tested on
Node version 11.2.0
Node version 11.5.0

Which terms did you search for in User Guide?

The issue is with the spread operator for attributes
https://reactjs.org/docs/jsx-in-depth.html#spread-attributes

Environment

Cannot run this, in my env it returns the error ( even run as admin )

npm ERR! code ENOLOCAL
npm ERR! Could not install from "kyleg\AppData\Roaming\npm-cache\_npx\1848" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\kyle\AppData\Roaming\npm-cache\_logs\2018-12-26T05_33_31_814Z-debug.log
Install for create-react-app@latest failed with code 1

Steps to Reproduce

  1. Try to use JSX spread Attributes on an app that will render in IE-11
    EXAMPLE: from the website
function App2() {
  const props = {firstName: 'Ben', lastName: 'Hector'};
  return <Greeting {...props} />;
}

Expected Behavior

create-react-app should use babel env 'usage' to polyfill so that you do not get the error.
Object doesn't support property or method 'assign'
In IE-11

Actual Behavior

You get the error:
Object doesn't support property or method 'assign'
In IE-11

Not sure why, but images would not post, Images are hosted on imgur here:
https://imgur.com/a/qFTMRce

UPDATE:

so starting to realize there is very little reason to ever use this anyway... Maybe that is why no one has seemed to mention / notice this before. Basically deciding that there are far to many ways around this + seems like bad practice to use it anyway. You may want to look into this further since it does seem to be not supported by create-react-app out of the box, even though it is still a seemingly useless feature with so many more viable workarounds available.

@Timer
Copy link
Contributor

Timer commented Dec 27, 2018

Please see the documentation about supported browsers: https://facebook.github.io/create-react-app/docs/supported-browsers-features

@Timer Timer closed this as completed Dec 27, 2018
@slaterbbx
Copy link
Author

slaterbbx commented Dec 27, 2018

Hey @Timer good to know, Not sure why I assumed that preset env was being used with 'usage'.
But makes sense, sorry for the wasted time.

I see the docs clearly say "Note that this project includes no polyfills by default." lol, so yea, my bad :-D

Kyle

@lock lock bot locked and limited conversation to collaborators Jan 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants