Warm tip: This article is reproduced from stackoverflow.com, please click
autodesk-forge autodesk-viewer javascript reactjs

Autodesk forge Viewer in React Application markup extension`s not all functions don`t come

发布于 2020-04-23 18:43:08

I have a React Apllication and integrated Autodesk forge viewer. I have a markup extension for viewer and its work correctly without React. When i try to add extension to React viewer, extensions functions are loaded not fully (all functions beside onToolbarCreated). I need to know where i must include extensions javascript file and why onToolbarcreated function is not loaded?

i got this error in console`

error in console

Extension code here

Questioner
Hovo216
Viewed
149
Bryan Huang 2020-02-13 13:24

A few things to check here:

  • onToolbarCreated is only effective when using Viewer v7 or later
  • it'd only get called after the Autodesk.Viewing.TOOLBAR_CREATED_EVENT event is fired
  • you can either add a breakpoint inside your function or print to the console in there to detect if and when it's called instead of printing it to the console in your load callback ...