React-diagrams: Uncaught TypeError: Cannot read property 'getLayers' of null

Created on 18 Dec 2019  路  2Comments  路  Source: projectstorm/react-diagrams

I am trying to migrate from v5 to v6 in a ES6 project, but I am having issues.
I've used the example code from https://projectstorm.gitbook.io/react-diagrams/getting-started/using-the-library.

Not sure what I am doing wrong, this should work for ES6 too, right?

index.js:24 Uncaught TypeError: Cannot read property 'getLayers' of null at Component.render (index.js:24) at finishClassComponent (react-dom.development.js:18450) at updateClassComponent (react-dom.development.js:18403) at beginWork$1 (react-dom.development.js:20160) at HTMLUnknownElement.callCallback (react-dom.development.js:337) at Object.invokeGuardedCallbackDev (react-dom.development.js:386) at invokeGuardedCallback (react-dom.development.js:441) at beginWork$$1 (react-dom.development.js:25737) at performUnitOfWork (react-dom.development.js:24661) at workLoopSync (react-dom.development.js:24637)

question

Most helpful comment

What is the value of the "engine" prop? Can you share the code please?

All 2 comments

What is the value of the "engine" prop? Can you share the code please?

Oh man, I've found the issue after checking the engine prop (where model was null), the function where this.engine.setModel(this.model); happens was never called!

Thanks for your hint, Pierre!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Nesterov-Konstantin picture Nesterov-Konstantin  路  4Comments

CarlousF picture CarlousF  路  3Comments

Naveenraj006 picture Naveenraj006  路  3Comments

t-gacema picture t-gacema  路  4Comments

DanieLazarLDAPPS picture DanieLazarLDAPPS  路  3Comments