How to properly type props in single-spa-react lifecycles using TypeScript? #1302
Unanswered
trend-mars-y-huang
asked this question in
Q&A
Replies: 1 comment
-
single-spa@7 is a javascript -> typescript migration - I recommend upgrading to it for new typescript + single-spa projects. I hope to migrate single-spa-react and single-spa-vue to typescript (rather than the manual declarations currently used) sometime in the future. The |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone! 👋
I'm using single-spa-react in a TypeScript project, and I've followed the basic setup pattern like this:
Currently, I'm typing the props as
any
, but I'd love to do it in a more TypeScript-friendly way. However, I couldn't find an official Props type from single-spa or single-spa-react.Is there an official type definition for the props passed to bootstrap, mount, and unmount? Or should I define a custom interface myself?
Thanks in advance for any guidance or best practices! 🙏
Beta Was this translation helpful? Give feedback.
All reactions