diff --git a/examples/forms/input-type-file.js b/examples/forms/input-type-file.js index 5cc084d9f..93dd13fc9 100644 --- a/examples/forms/input-type-file.js +++ b/examples/forms/input-type-file.js @@ -1,27 +1,44 @@ class FileInput extends React.Component { constructor(props) { super(props); - this.handleSubmit = this.handleSubmit.bind(this); + this.handleSubmit = this.handleSubmit.bind( + this + ); } -// highlight-range{1-4} - handleSubmit (event) { + // highlight-range{5} + handleSubmit(event) { event.preventDefault(); - alert(`Selected file - ${this.fileInput.files[0].name}`); + alert( + `Selected file - ${ + this.fileInput.files[0].name + }` + ); } render() { return ( -
); } } -ReactDOM.render(