Comments (3)
Hey @edu-bound
I'm sorry but I'm not sure I clearly understand the issue, may I ask for some examples, please?
from use-debounce.
Sure. In package.json
, the exports field is as follows,
{
"exports": {
"./package.json": "./package.json",
".": {
"import": "./esm/index.js",
"require": "./lib/index.js"
}
}
}
Some tools recoginze the exports
field and change their behavior based on its value. An example of such a tool is the ESLint plugin eslint-plugin-import-alias.
When a type not declared in the exports
field is imported it, understandably, throws the following error,
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/useDebouncedCallback' is not defined by "exports" in /home/aryzing/workspace/project/node_modules/use-debounce/package.json
Therefore the ask is to please include useful types (in particular the one I'm after is DebouncedState<T>
) in the exports
fields. To TS consumers, it makes sense to have them as part of the package's exposed API.
Eg, with the current structure of the published package,
{
"exports": {
"./package.json": "./package.json",
".": {
"import": "./esm/index.js",
"require": "./lib/index.js"
},
"./esm/useDebouncedCallback": {
"import": "./esm/useDebouncedCallback.d.ts"
}
},
}
from use-debounce.
got it, please, feel free to make a PR
from use-debounce.
Related Issues (20)
- Bad example for useDebouncedCallback in README HOT 8
- How do you mock useDebounce? HOT 5
- ` useDebouncedCallback` does not have ` equalityFn` option in the type definition. HOT 2
- value controller reference changes on every render HOT 2
- "leading: true" not working for v7 HOT 8
- create-react-app 5 compatibility HOT 4
- useDebouncedCallback does not update state when react-dev-tools is open HOT 2
- errors in debounce fn are not propagated HOT 1
- useDebouncedCallback gives incorrect import suggestion in VSCode HOT 2
- Jest 28.0.0 and jest-environment-jsdom fails to import use-debounce in tests HOT 6
- Seems like useDebouncedCallback is executing async functions in render scope HOT 2
- use-debounce to auto-save multi input form HOT 1
- useDebouncedCallback should return the callback function HOT 3
- Cannot use import statement outside of a module - running with jest in ESM mode HOT 1
- Cannot find module 'use-debounce' HOT 6
- [9.0.1] TS7016: Could not find a declaration file for module 'use-debounce'. HOT 8
- Not react hook? HOT 1
- useDebouncedCallback - doesnt update when inner function updates HOT 2
- API of hooks are not documented HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from use-debounce.