1.0.2 • Published 1 year ago
react-use-open-file-dialog v1.0.2
react-use-open-file-dialog
Made with create-react-library
Install
npm install --save react-use-open-file-dialog
Usage
import { useOpenFileDialog } from 'react-use-open-file-dialog'
export default function App() {
const openFileDialog = useOpenFileDialog()
const openFile = async () => {
const list = await openFileDialog()
console.log('list:', list)
}
return <button onClick={openFile}>open</button>
}
console output
list: [{
"file": {
lastModified: 1680821066335
lastModifiedDate: Fri Apr 07 2023 07:44:26 GMT+0900 (한국 표준시) {}
name: "example.txt"
size: 18
type: "text/plain"
webkitRelativePath: ""
},
"text": "This is file text."
}]
License
MIT © stacew