Closed Bloemendaal closed 3 years ago
Theoretically you can do it thanks to the ref
:
const ref = useRef<HTMLInputElement[]>([]);
function setValue(pin: string) {
if (ref.current) {
ref.current.forEarch((input, idx) => {
input.value = pin[idx];
});
}
}
return <PinField ref={ref} />;
Let me know if it helps you.
Cool! That works great! Thanks! 😁👏
Hi!
I was wondering if it is possible to set an initial value, e.g. when the code is already supplied in the query parameters.
Thanks :)