Git Product home page Git Product logo

Comments (10)

gandm avatar gandm commented on May 21, 2024

This is nothing to do with language-babel. That message is passed back from the Babel API. I would imagine you would also get this message from the Babel CLI. You have to enable the spread transformer es6.spread or set the stage to enable it. Either use the babelrc files or set via settings.

from language-babel.

gandm avatar gandm commented on May 21, 2024

spread as a lhs?

from language-babel.

diego-toro avatar diego-toro commented on May 21, 2024

I'm using webpack so I just disabled the transpile and that's it, but I'm still wondering about it, I was using a destructuring with "..." to keep the props and with webpack is working well.

And... Sorry may I ask What is lhs?

from language-babel.

mathieumg avatar mathieumg commented on May 21, 2024

What is lhs?

Left-hand side

from language-babel.

gandm avatar gandm commented on May 21, 2024

The LHS spread should be an array.
e.g
[ a, b, ...c ] = this.props

from language-babel.

gandm avatar gandm commented on May 21, 2024

Sorry I misunderstood what you were doing. Yes this should work if the correct stage is set in either babelrc or settings.

from language-babel.

diego-toro avatar diego-toro commented on May 21, 2024

ooooo yes, but I'm using destructuring also https://babeljs.io/docs/learn-es2015/#destructuring like this

bla=>{
  const {a, b, ...props} = this.props;
}

from language-babel.

diego-toro avatar diego-toro commented on May 21, 2024

yeah, but I don't know where to put it on settings, Just now I think I broke Atom.

from language-babel.

gandm avatar gandm commented on May 21, 2024

This is experimental stage 1 or use transformer es7.objectRestSpread https://github.com/sebmarkbage/ecmascript-rest-spread

You can set this in .babelrc file or language-babel settings. In language Babel's settings put es7.objectRestSpread in the Optional Transformers field Or use stage 1
In babelrc use stage 1 or use the 'optional' option.

I've never used the webpack loader so I don't know why this works without these settings. I may have a look given time.

from language-babel.

diego-toro avatar diego-toro commented on May 21, 2024

Thanks a lot!!!
It works awesome in Optional Transformers and I just added another one

es7.objectRestSpread, es7.decorators

from language-babel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.