frandiox / vitedge

Edge-side rendering and fullstack Vite framework
https://vitedge.js.org
MIT License
732 stars 31 forks source link

fix: update typings for useContext to be callable #90

Closed thyb closed 2 years ago

thyb commented 2 years ago

Hello,

There is a Typescript definition issue when using: const { request } = useContext(). We get the following error:

This expression is not callable.
  Type 'Omit<SharedContext, "request" | "response">' has no call signatures.

This small PR fix this error by making useContext callable.