Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
TypeScript type {price: number | string} - Theo's Typesafe Cult
TTC
Theo's Typesafe Cult
•
3y ago
•
1 reply
serg
TypeScript type {price: number | string}
How to fix type error Type
'string
' is not assignable to type
'number
' in a form
,
I have a controlled input name
=
"price
" that i want to give a init value of empty string
, onChange handles the input change making it of type number
.
Theo's Typesafe Cult
Join
26,131
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Zod type email string and number message not working correctly
TTC
Theo's Typesafe Cult / questions
3y ago
TypeScript error: Type 'string' is not assignable to union value
TTC
Theo's Typesafe Cult / questions
3y ago
Type 'string | null' is not assignable to type 'string | undefined'.
TTC
Theo's Typesafe Cult / questions
3y ago
// ? ^^ TypeScript Type Hint Extension
TTC
Theo's Typesafe Cult / questions
3y ago