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

babel spread operator problem #15

Closed
loelsonk opened this issue Apr 11, 2017 · 2 comments
Closed

babel spread operator problem #15

loelsonk opened this issue Apr 11, 2017 · 2 comments

Comments

@loelsonk
Copy link

loelsonk commented Apr 11, 2017

Hello, I've a problem with babel transpiling.

npm run start // command I use to run
npm -v 4.1.2
node -v v7.5.0

Standard ES6 I copied from reacttraining examples.

The code: (don't mind this 1===1, it's just for testing)

const PrivateRoute = ({ component: Component, ...rest }) => (
  <Route {...rest} render={props => (

    1===1 ? (
        console.log(props);
      ) : (
        <Redirect to={{
          pathname: '/sign-in',
          state: { from: props.location }
        }}/>
      )
  )}/>
)

Besides default reactQL .babelrc I tried following setup:

{
  "presets": [ "react", "stage-3",
    ["env", {
      "targets": {
        "node": true
      }
    }]
  ]
}

Here is error I am receiving:
Image

Not sure why it is not working. Clearly I am missing something.

@leebenson
Copy link
Owner

@loelsonk - npm i -g reactql to 2.0.1, and this should now work.

@loelsonk
Copy link
Author

Thanks, it is working now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants