question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error with ES7 + React

See original GitHub issue

Tried with Facebook react-create-app and I get: react.js:1 Uncaught SyntaxError: Unexpected token import

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nosircommented, Oct 12, 2016

Had a look, the easiest way is to use bundled cleave file, in order to avoid ES future babel transpiler.

So in your App.js:

import React, { Component } from 'react';
import Cleave from 'cleave.js/dist/cleave-react.min';
import CleavePhone from 'cleave.js/dist/addons/cleave-phone.gb';

class App extends Component {
  render() {
    return (
      <div>
        <Cleave placeholder="Enter phone" options={{phone: true, phoneRegionCode: 'GB', noWarning: CleavePhone}}/>
      </div>
    );
  }
}

export default App;
0reactions
chmaniecommented, Oct 31, 2016

First of all, thank you for putting together this great library!

I do, however, have the exact same error using Meteor and react. It’d be great if it just worked out of the box. I’ll try to use the workaround for now!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ES7 React/Redux/GraphQL/React-Native snippets not working
Search command You can search through snippets with ES7 snippet search command which can be run with CMD + Shift + P or...
Read more >
vim-plug is not working properly · Issue #141 - GitHub
using coc.nvim and vim-plug , the following error message is shown. [coc.nvim] extension "es7-react-js-snippets" doesn't contain main file.
Read more >
ES7 React/Redux/GraphQL/React-Native snippets
This extension provides you JavaScript and React/Redux snippets in ES7 with Babel plugin features for VS Code.
Read more >
ES7 React/Redux/GraphQL/React-Native Snippets - YouTube
In this Video Series, I'll will be talking about the extension that are useful for developer to quickly code in React /Javascript.
Read more >
Code faster with ES7 React Snippets VS code extension
Code faster with ES7 React Snippets VS code extension. 1.5K views 11 months ago. Coder Amrin. Coder Amrin. 128 subscribers. Subscribe.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found