We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
interface SearchPriceProps { onPriceChange: (event: React.ChangeEvent<HTMLInputElement>) => void price: number } const SearchPrice = (Props: SearchPriceProps) => { return ( <div> Price: <input type="text" value={Props.price} onChange={Props.onPriceChange} /> </div> ) }
// react hook const [price, setPrice] = useState(999)
And in the code
<SearchPrice price={price} onPriceChange={e => { setPrice(parseInt(e.target.value)) }} />
#ref https://www.pluralsight.com/guides/typescript-pass-function-react