To upload a file from react component, A developer will require to write Controlled component An uncontrolled component Can be done from both None of above code example
Example: react file input
<input type="file" />
<input type="file" />