How to share WebViewer Instance in Typescript?

WebViewer Version: 8.7.0

Can you reproduce using one of our samples or online demos?
It is possible by just doing the actual guide in JS.
Link: Sharing WebViewer instance across components

Are you using the WebViewer server? No
Does the issue only happen on certain browsers? No
Is your issue related to a front-end framework? Yes
Is your issue related to annotations? No

Please give a brief summary of your issue:
How to create a context of the WebViewer Instance

Please describe your issue and provide steps to reproduce it:
It is pretty easy to do it again, i just followed the guide that i linked above. And try to adapt it in Typescript, but i didnt understood how to implement it. Always have a problem of “undefined” or smth.

Can someone show me how we can reproduce it but in Typescript ?

I’d like to avoid prop drilling of the instance on my current project.

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi Nithish,

To diagnose further to the issue, could you please provide the following information?

  1. The minimum sample project that the error could be reproduced.
  2. The screenshot of the error

Thank you.