import { useState } from "preact/hooks"; export interface SearchBarProps { value: string; onChange: (value: string) => void; } export function SearchBar(props: SearchBarProps) { const { value, onChange } = props; const [inputValue, setInputValue] = useState(value); return (
{ if(e.currentTarget){ setInputValue(e.currentTarget.value); onChange(e.currentTarget.value); } }}/>
); }