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.

Cannot use G6 with React

See original GitHub issue
  • G6 Version: @antv/g6": "3.4.0", (Have tried @latest too)
  • Platform: OSX 10.15.3
  • Mini Showcase(like screenshots):
yarn add @antv/g6
Open file to include
import G6 from "@antv/g6"
yarn start

Whenever I import G6 from "@antv/G6"; and run yarn start I get the following error.

node_modules/@antv/g6/dist/g6.min.js:24:315787: Unexpected token, expected "," (24:315787)
  22 |  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  23 |  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
> 24 |  */(function(){var o="Expected a function",a="__lodash_placeholder__",u=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],s="[object Arguments]",c="[object Array]",f="[object Boolean]",h="[object Date]",l="[object Error]",d="[object Function]",p="[object GeneratorFunction]",g="[object Map]",v="[object Number]",y="[object ...

25 | //# sourceMappingURL=g6.min.js.map

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
laubonghaudoicommented, Apr 1, 2020

I am using pure react without umi and it works fine. Maybe you should look into that demo.

0reactions
baizncommented, Apr 18, 2020

@jshuadvd remove umi dependencies, add webpack & babel dependencies https://github.com/baizn/g6-in-react

Read more comments on GitHub >

github_iconTop Results From Across the Web

antv/g6 and react. How to update graph? - Stack Overflow
Please note that whenever data is changed, a new G6.Graph will be called. So a new canvas will be created. Try the following...
Read more >
Getting Started - G6
Step 2: Import the JS file to the file where G6 is going to be used: ... For more information about it, please...
Read more >
Using Your G6 - Amazon S3
WARNING: Failure to use the Dexcom G6 Continuous Glucose Monitoring System (G6) and its components according to the instructions for use and all...
Read more >
Use JSX-like syntax to customize G6 nodes
In G6 V3.7.0 and later version, user are allow to use JSX-like syntax to customize ... and others supported by JSON (note that...
Read more >
Ant Design Charts | AntV
AntV react component library. ... easy to use. The React component uses charts in a simple configuration that renders elegant, standard charts. advantage....
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