the value is not set in state hooks
`
> const Post = (props) => {
>
> const [selectedFile, setselectedFile] = React.useState([]);
>
> const upload=event=>{
>
> setselectedFile(selectedFile,event.target.files[0]);
>
> }
>
> }`
you only need to set the current state.
If you want to maintain a list of selected files then do the following
If you only want to maintain the current file then do this