I have used useRef hook from react
const myInput = useRef()
And pass it to material-ui OutlinedInput component
<OutlinedInput
id="outlined-adornment-amount"
inputRef={myInput}
type="file"
startAdornment={<InputAdornment position="start">
<FolderIcon fill="#333" />
</InputAdornment>}
labelWidth={60}
/>
when I try to set the input's property in within useEffect
useEffect(() => {
myInput.current.directory = true
}, [])
I get
Uncaught TypeError: Cannot set property 'directory' of undefined
if (myInput.current) { myInput.current.directory = true }