Git Product home page Git Product logo

Comments (12)

streamich avatar streamich commented on April 19, 2024 3

This is not a solution, but I think if you import individual hooks like

import myHook from 'react-use/lib/myHook';

it should work, or doesn't it?

from react-use.

benneq avatar benneq commented on April 19, 2024

I have similar issues:

Could not find a declaration file for module 'use-callbag'. 
Could not find a declaration file for module 'use-onclickoutside'. 
Could not find a declaration file for module 'react-wait'

Maybe those typings should be a hard dependency for react-use?

from react-use.

j-f1 avatar j-f1 commented on April 19, 2024

The problem with use-callbag is that it doesn’t even have typings for TS.

from react-use.

benneq avatar benneq commented on April 19, 2024

from react-use.

streamich avatar streamich commented on April 19, 2024

Well I'm using that approach, and that's why I haven't seen this TypeScript error and haven't had incentive to fix it, sorry for that 😃

from react-use.

benneq avatar benneq commented on April 19, 2024

from react-use.

streamich avatar streamich commented on April 19, 2024

use-callbag and use-onclickoutside are not part of dependencies anymore. Do you still see this error?

from react-use.

dcporter avatar dcporter commented on April 19, 2024

Yes — react-wait is causing problems (looks like it has an @types (here)! 🎉), as are usePermission’s own types (several are not found).

from react-use.

xobotyi avatar xobotyi commented on April 19, 2024

@streamich maybe we should exclude react-wait from default export and add react-wait and @types/react-wait to the optionalDependencies?

from react-use.

streamich avatar streamich commented on April 19, 2024

react-wait types are now re-expoted, it works for me with Webpack.

@dcporter do see errors caused by react-wait when using latest version? What is your setup?

from react-use.

dcporter avatar dcporter commented on April 19, 2024

It's looking very hopeful. I'll close this out once my local project's PR makes it all the way through the pipeline without mishap. Thanks! :D

from react-use.

dcporter avatar dcporter commented on April 19, 2024

Looks good now, I'm able to import hooks from root! This presented as a binary "everything works or everything is broken" situation, so I'm confident that everything is in a stable place now.

Thanks a ton. (I realized that this is not my issue so I can't close it. But @j-f1 can!)

from react-use.

Related Issues (20)

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.