CopyPastor

Detecting plagiarism made easy.

Score: 0.8066520690917969; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2020-05-14
by meck373

Original Post

Original - Posted on 2015-10-05
by mpen



            
Present in both answers; Present only in the new answer; Present only in the old answer;

This is my solution: function mainPage(){ const [newFile, SetNewFile] = useState([]);
const fileChange = (event) => { SetNewFile( event.target.files[0] ); }; const onFormSubmit = () =>{ // Do something }
return( <Form onSubmit={onFormSubmit}> <Form.Field> <Button as="label" htmlFor="file" type="button"> Some button stuff </Button> <input type="file" id="file" hidden onChange={fileChange} /> </Form.Field> <Button type="submit">Upload</Button> </Form>) }
If you're already using lodash, the [`_.times`](https://lodash.com/docs#times) function is handy.
import React, { Component } from 'react'; import Select from './Select'; import _ from 'lodash'; export default class App extends Component { render() { return ( <div className="container"> <ol> {_.times(3, i => <li key={i}> <Select onSelect={this.onSelect}> <option value="1">bacon</option> <option value="2">cheez</option> </Select> </li> )} </ol> </div> ); } }

        
Present in both answers; Present only in the new answer; Present only in the old answer;