0.0.15 • Published 3 years ago

custom-react-uploader v0.0.15

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Custom React Uploader

Usage

One line of code worths thousands lines of explanations.
import React, { useEffect, useState } from 'react'
import Uploader, { convertUrlToUploadFileModel, UploadFileModel }  from 'custom-react-uploader'
import styles from './styles.module.scss'
const testUrl = `https://media.istockphoto.com/photos/desk-lamp-picture-id534400418?b=1&k=20&m=534400418&s=170667a&w=0&h=kWgxXtGPOGYwOg5WdvFebM_z3wAQBUG2wrTf24oBWTc=`
const Container: React.FC<any> = () => {
    const [images, setImages] = useState<UploadFileModel[]>([])
    useEffect(() => {
        convertUrlToUploadFileModel(testUrl, 'testName.jpg').then((res) => {
            setImages([res])
        })
    }, [])
    return <div className={styles.container}>
        <Uploader currentFiles={images} updateCurrentFiles={setImages} onError={(message, file) => {
            console.log('error ', message, file)
            }} multiple={true}
            onlyShowFileInfo={false}        
        />
    </div>
}

export default Container

Development

  1. Git clone the project https://github.com/duc168/custom-react-uploader.git
  2. Install lerna globally if you have not installed lerna yet, run yarn add lerna -g
  3. Run yarn to install the first packages
  4. yarn start to start developing
  5. yarn stop to stop developing
  6. yarn build to build a new version
Happy coding!
0.0.15

3 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.14

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago