How is option value string even after accepting a ``value={prop}`` of a number type?

Argument of type 'string' is not assignable to parameter of type 'SetStateAction<number>' Meanwhile I type setCurrentPage: (page: number) => void because the only thing i want it to accept must only be numbers
<select name="num" onChange={(e) => setPerPage(e.target.value)}>
{select.map((prop, index) =>{
return(
<option value={prop} key={index}>{prop}</option>
)
})}
</select>
<select name="num" onChange={(e) => setPerPage(e.target.value)}>
{select.map((prop, index) =>{
return(
<option value={prop} key={index}>{prop}</option>
)
})}
</select>
How is option value string even after accepting a value={prop} of a number type?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server