I have rsuite SelectBox, I want to reset its value from outside. when I set it to null
or undefined
or empty string, it doesnt work.
I read the source code, I get the felling that it is by design, only when you use it as part of a form. but this complicate things.
Do you see any possible way to reset the combo value without creating a form?
https://codesandbox.io/s/select-picker-types-forked-ivjn8?file=/src/App.tsx:164-477
export default function App() {
const [value, setValue] = useState<string | undefined>();
return (
<>
<SelectPicker
data={[{ label: "test", value: "test" }]}
value={value}
onChange={setValue}
/>
<button onClick={() => setValue("")}>reset</button>
</>
);
}
Thanks