npm i react-dropzone -s
npmjs.com/package/react-dropzone
import React from 'react' import Dropzone from 'react-dropzone' <Dropzone onDrop={acceptedFiles => console.log(acceptedFiles)}> {({getRootProps, getInputProps}) => ( <section> <div {...getRootProps()}> <input {...getInputProps()} /> <p>Drag 'n' drop some files here, or click to select files</p> </div> </section> )} </Dropzone> |
'basic > React.js' 카테고리의 다른 글
[React.js] Context (0) | 2021.03.02 |
---|---|
[React.js] 이벤트핸들러 인자 전달 (0) | 2021.02.21 |
[React.js] react-router-dom (0) | 2021.02.20 |
[React.js] Enter 이벤트 (0) | 2021.02.19 |
[React.js] history 객체 이용하기 (0) | 2021.02.17 |