Skip to content

non jsx spread operators depend on Object.assign #2488

Closed
@jquense

Description

@jquense
var c = { ...a, x: 1 }

transpiles to

var c = Object.assign({}, a, { x: 1 })

It works all nice and dandy but it implicitly requires a polyfill that is undocumented. I assume this is because of the recent change to move the polyfill into a module? Perhaps react (react-tools) should not use the jstransform spread visitor, using one that leverages React.__spread as in the jsx case? Or at perhaps just a note in the docs somewhere that you will need Object.assign polyfilled.

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