useparagon / paragon-connect-nextjs-example

An example todo list app showcasing embedded integrations with Paragon.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in useParagonGlobal with Typescript

prateekjain98 opened this issue · comments

I have the project built in Typescript and when I use the existing code of useParagonGlobal hook, it gives error for window.paragon and paragon.
paragonError

commented

You might want to add this to tell TS that paragon object exists in global window:

declare global {
  interface Window {
    paragon: any
  }
}

Good find @nrayamajhee, and thanks for flagging @prateekjain98 - I just updated this repository to use our new npm package, which ships with our official TS types.

If you're already using the <script> tag or importing our types via a global types file, see our migration instructions in the docs: https://docs.useparagon.com/getting-started/installing-the-connect-sdk

Thanks!