Using the Debug version with the React integration package

I am using the GoJS React Integration package (https://www.npmjs.com/package/react-gojs).

How do I use the Debug version of GoJS (go-debug.js) along with the React Integration package?

Please note that we do not maintain that project, it was created by someone else.

You should be able to link to the go-debug.js file in your import, I think. So instead of:

import * as go from 'gojs';

try:

import * as go from 'gojs/release/go-debug.js';

I tried this and got the following error message:

TS2322: Type '(id: string) => go.Diagram' is not assignable to type '(id: string) => import("/Users/nbaltatzis/work/bbdata-ui/node_modules/gojs/release/go").Diagram'.
  Type 'go.Diagram' is not assignable to type 'import("/Users/nbaltatzis/work/bbdata-ui/node_modules/gojs/release/go").Diagram'.
    Property 'computeBounds' is protected but type 'Diagram' is not a class derived from 'Diagram'.

I didn’t realize that the GoJS React package was created by someone outside your organization.

Do you recommend using it or is there another recommended way to use GoJS within a React app?

Yes, it is fine to use it, we know many people are. That being said, we are working on some React samples.

You may need to use

import * as go from 'gojs/release/go-debug'

without the .js at the end. You may also need to modify the react-gojs files to use the same reference so all instances of the go object are the same.