Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Typescript Determining type of generic. - Theo's Typesafe Cult
TTC
Theo's Typesafe Cult
•
4y ago
•
4 replies
Xaohs
Typescript Determining type of generic.
Hi
, I have the following generic function
const
handleContinue
=
<
T
extends
A
|
B
>(
data
:
T
)
=>
{}
const
handleContinue
=
<
T
extends
A
|
B
>(
data
:
T
)
=>
{}
How can I check inside this function when data
= A
, or when data
= B
?
Theo's Typesafe Cult
Join
26,564
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
React Typescript useContext( ) generic type
TTC
Theo's Typesafe Cult / questions
4y ago
Typescript generic field selection assumes type incorrectly
TTC
Theo's Typesafe Cult / questions
2y ago
Generic Zod Type without defining generics?
TTC
Theo's Typesafe Cult / questions
3y ago
Multiple Generics In Typescript Type
TTC
Theo's Typesafe Cult / questions
3y ago