I'm trying to make a simple textinput with send button. It works but I'm not sure this is best practice.
interface TodoInputProps {
append: (...items: string[]) => void
}
const TodoInput = ({ append }: TodoInputProps) => {
const [str, setStr] = useInputState('')
return (
<Group>
<TextInput value={str} onChange={setStr} />
<ActionIcon
onClick={() => {
append(str)
setStr('') // <-- here
}}
/>
</Group>
)
}