this is my Form, the props comes from a selector.
const FormIntestazione = (props) => {
const dispatch = useDispatch();
const intestazione = props.intestazione;
const handleChange = (event) => {
dispatch(actionSetContratto(event.target.id, event.target.value));
}
return (
<Box id="intestazione"
component="form"
sx={{
'& .MuiTextField-root': { m: 1, width: '25ch' },
}}
noValidate
autoComplete="off"
>
<div>
<div >
<TextField
label="Numero Riferimento"
value={intestazione.Riferimento}
onChange={handleChange}
id="Riferimento"
size="small"
/>
</div>
</div>
</Box>
)
};
this is the action
export const actionSetContratto = (id, value) => ({ type: SET_CONTRATTO, id: id, value: value })
i know there is many guides online but i can't find one fitting to my case. Could someone please help me? I want to debounce the handlechange of the input and i can't. I tryed with lodash and by defining my own debounce func.
thanks.