serg
serg
TTCTheo's Typesafe Cult
Created by serg on 12/21/2023 in #questions
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.
2 replies