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

Problems with using in react #14

Closed
ShaubertIlya opened this issue Jan 10, 2018 · 2 comments
Closed

Problems with using in react #14

ShaubertIlya opened this issue Jan 10, 2018 · 2 comments

Comments

@ShaubertIlya
Copy link

Hello and good day. Sorry if the question is silly but can you give an advice about the mistake i've got?
I've installed library throw command "npm install litegraph.js" and now i see it's folder inside of my modules folder. I imported it like this " import LGraph from 'litegraph.js' ". React shows me an error

ReferenceError: LGraph is not defined

My code:

import React, { Component } from 'react';
import {Layer, Rect, Stage, Group} from 'react-konva';
import LiteGraph from 'litegraph.js'
import LGraph from 'litegraph.js'

class MyRect extends Component
{
render()
{
var graph = new LGraph();

    return(
        <canvas id='mycanvas' width={1024} height={720}></canvas>
    );
}

}

export default MyRect;

@jagenjo
Copy link
Owner

jagenjo commented Jan 10, 2018

LiteGraph is not supported by node yet, so it doesnt work in systems like react that rely in modules

@jagenjo jagenjo closed this as completed Jan 10, 2018
@vivekascoder
Copy link

Is it still the case?

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

3 participants