RJ
RJ•3y ago

Exposing ConvexAPI without using React

Separately, the type ConvexAPI https://docs.convex.dev/generated-api/react#convexapi that lives in _generated/react.d.ts seems like it's not React-specific, and could perhaps be nice to extract for the use of other clients
2 Replies
ballingt
ballingt•3y ago
Totally, we could split it out into a _generated/api.d.ts and _generated/react.d.ts. If you don't mind a devDependency on react + @types/react you could use this now in the non-React client you're writing, but I've filed this request! For now you could try import type { ConvexAPI } from convex/_generated/react, but yeah this will require the users of your client to install @types/react as a dev dependency for no other reason.
RJ
RJOP•3y ago
That's no problem for me at the moment 🙂

Did you find this page helpful?