I would like to set a default time to a textfield type time of Material UI. My requeriment is that before clicking the picker, no time have been settted up, but when clicking, appears 08:00 as the default time to pick.
Turn your TextField into a controlled component, by giving it a value that is set to state, and update it onChange.
There are no focus or click handler props for that API, but you can wrap the TextField with a span and set a click handler on that.
From there, create a function to update the state to be a string value of "08:00" if there is no value in the event target. This will allow you to reuse the function for onClick and onChange with little overhead.
const [time, setTime] = useState("")
const changeTime = (e) => {
setTime(e.target.value || "08:00")
}
<span onClick={changeTime}>
<TextField value={time} type="time" onChange={changeTime}/>
</span>
The onClick works because of event bubbling. You will be clicking the input, but that bubbles up to the span's event listener. There should be no chance of clicking on the span, because it will fit the content, and input will lay over it.