textfield number mui settext from params
const textFieldRefNumber = useRef();
const [quantity, setQuantity] = React.useState("");
const location = useLocation();
if (typeof location.state !== "undefined") {
const params = location.state.item;
textFieldRefNumber.current.value = params.quantity;
}
const handleChangeQuantity = (event) => {
setQuantity(event.target.value);
};
<TextField
inputRef={textFieldRefNumber}
required
id="outlined-required"
label="number"
defaultValue={quantity}
onChange={handleChangeQuantity}
fullWidth
inputProps={{ min: 0, max: 10000 }}
type={"number"}
InputLabelProps={{ shrink: true }}
/>