Giter Site home page Giter Site logo

Comments (8)

mumumu-ko avatar mumumu-ko commented on May 27, 2024 1

I have the same problem in Ver1.0.9.
I solved it by defining Type in index.d.ts.
See below.

declare module "use-file-upload" {
    type FileUpload = {
        source: URL;
        name: string;
        size: number;
        file: File;
    }

    type Callback = (file: FileUpload | [FileUpload]) => void;

    const useFileUpload: () => [
        file<FileUpload | [FileUpload]>,
        selectFiles<({ accept: string, multiple: boolean }, callback: Callback) => void>,
    ]
}

Type definition issues in newer versions of React...?
Thnaks.

from use-file-upload.

norbiu avatar norbiu commented on May 27, 2024 1

Any update on this?

from use-file-upload.

intergalactic-overlords avatar intergalactic-overlords commented on May 27, 2024 1

create a PR to fix this: #4

from use-file-upload.

Marvinified avatar Marvinified commented on May 27, 2024

@nvrsantos Can you please provide more context, I couldn't reproduce your error.

from use-file-upload.

mariosantosdev avatar mariosantosdev commented on May 27, 2024

I dont undestand why that happen, but I install the version 1.0.8 and created an custom declare file, and it has been temporarily fixed.

image

from use-file-upload.

Marvinified avatar Marvinified commented on May 27, 2024

@nvrsantos I will look into this and try to make a fix but I would need more info about your code setup to be able to reproduce the error. Thanks.

from use-file-upload.

mariosantosdev avatar mariosantosdev commented on May 27, 2024

What kind of information do u need?

from use-file-upload.

mariosantosdev avatar mariosantosdev commented on May 27, 2024

Great job!

from use-file-upload.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.