Skip to content

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

Closed

Description

@slaterbbx

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.

Activity

  1. Timer commented on Dec 27, 2018

    @Timer
    Contributor

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

  2. slaterbbx commented on Dec 27, 2018

    @slaterbbx
    Author

    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

  3. locked and limited conversation to collaborators on Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions