Working with file upload is one of those things you somehow wind up doing. Here is a small article on doing the same in React
First of all, we need to understand on how refs work in React. Ref's act as pointers on DOM elements, like how you would be selecting an element using say
and the useContext Hook to manage those ref's
In this example, I have created a ref called inputRef that is connected to the input element, each element connected to the ref can a current property on which you can use all the properties supported by that element, in this case value
lets add the FileType, FormData and fetch API
Top comments (0)