
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
https://usehooks.com as an npm package with TypeScript type definitions
https://usehooks.com as an npm package with TypeScript type definitions.
npm install use-hooks
yarn add use-hooks
Hooks marked with "*" have minor differences (read below).
To supply a custom easing function just pass it as a first argument:
import { useAnimation } from 'use-hooks'
const inQuart = (t) => t * t * t * t
function MyComponent() {
const animation = useAnimation(inQuart, 250)
// ...
}
The class name and element are hard coded on the website but in this package they're changable:
import { useDarkMode } from 'use-hooks'
const rootElement = document.getElementById('my-root-element')
function App() {
useDarkMode('my-dark-mode-class-name', rootElement)
// ...
}
Added initialValue
to the clear
callbacks dependencies.
A second useDependencies
argument was added allowing the effect to re-run when arguments change.
A fourth useDependencies
argument was added allowing the effect to re-run when arguments change.
A third useDependencies
argument was added allowing the effect to re-run when arguments change.
Converted an Array.prototype.includes
call to an Array.prototype.indexOf
call to support ES5 environments.
isClient
boolean and getSize
function moved out of hook body.
Thanks to @gabe_ragland for creating and maintaining https://usehooks.com
Thanks to @turbobabr for donating use-hooks
package name
FAQs
https://usehooks.com as an npm package with TypeScript type definitions
The npm package use-hooks receives a total of 482 weekly downloads. As such, use-hooks popularity was classified as not popular.
We found that use-hooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.