Controlled File Input
class ControlledFileInput extends React.Component { | |
constructor(props) { | |
super(props); | |
this.handleChange = this.handleChange.bind(this); | |
} | |
handleChange(event) { | |
console.log('Selected file:', event.target.files[0]); | |
} | |
render() { | |
return ( | |
<Input | |
name="FileUpload" | |
onChange={this.handleChange} | |
type="file" | |
/> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment