New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@react-hookz/web

Package Overview
Dependencies
Maintainers
2
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-hookz/web - npm Package Compare versions

Comparing version 1.6.2 to 1.7.1

cjs/index.js

111

CHANGELOG.md

@@ -1,2 +0,2 @@

## [1.6.2](https://github.com/react-hookz/web/compare/v1.6.1...v1.6.2) (2021-04-22)
## [1.7.1](https://github.com/react-hookz/web/compare/v1.7.0...v1.7.1) (2021-04-23)

@@ -6,136 +6,145 @@

* add hook link to README.md ([368f1d9](https://github.com/react-hookz/web/commit/368f1d9b595eec113cadffa217ef01041a6a4c72))
* add ci yarn caching layer ([5aa8ae1](https://github.com/react-hookz/web/commit/5aa8ae199e72a88d17809cf5cc5023c7344ed025))
# [1.7.0](https://github.com/react-hookz/web/compare/v1.6.1...v1.7.0) (2021-04-22)
# [1.7.0](https://github.com/react-hookz/web/compare/v1.6.2...v1.7.0) (2021-04-23)
### Bug Fixes
* add `md` and `mdx` files to lint-staged hook glob ([d1d3d72](https://github.com/react-hookz/web/commit/d1d3d7200313c023f874e74720f9d787a9321d78))
* add readme clarification about different lang level usages ([0632992](https://github.com/react-hookz/web/commit/0632992a39f18e99ca4bd9929d6bdcdb236e9182))
* exclude new distributed directories from eslint and tsconfig ([058960e](https://github.com/react-hookz/web/commit/058960e9eb60893ce94504a3aac68d4ec1e131a4))
### Features
* add storybook docs with deploy to gh-pages ([84de312](https://github.com/react-hookz/web/commit/84de312a607f202c8957ae3f6d32c453cffe134a))
* package now has /cjs, /esm, /esnext distibuted versions ([4911c9d](https://github.com/react-hookz/web/commit/4911c9d3c0813bff5e52ae98cfc4dfc542996a0b))
## [1.6.1](https://github.com/react-hookz/web/compare/v1.6.0...v1.6.1) (2021-04-21)
# [1.7.0](https://github.com/react-hookz/web/compare/v1.6.2...v1.7.0) (2021-04-23)
### Features
- package now has /cjs, /esm, /esnext distibuted versions ([4911c9d](https://github.com/react-hookz/web/commit/4911c9d3c0813bff5e52ae98cfc4dfc542996a0b))
## [1.6.2](https://github.com/react-hookz/web/compare/v1.6.1...v1.6.2) (2021-04-22)
### Bug Fixes
* useUnmountEffect and useMountEffect typings fix ([32ec0c7](https://github.com/react-hookz/web/commit/32ec0c7f7b63c8d8941b95f5f8e5c369e5e87f1a))
- add hook link to README.md ([368f1d9](https://github.com/react-hookz/web/commit/368f1d9b595eec113cadffa217ef01041a6a4c72))
# [1.7.0](https://github.com/react-hookz/web/compare/v1.6.1...v1.7.0) (2021-04-22)
### Features
- add storybook docs with deploy to gh-pages ([84de312](https://github.com/react-hookz/web/commit/84de312a607f202c8957ae3f6d32c453cffe134a))
## [1.6.1](https://github.com/react-hookz/web/compare/v1.6.0...v1.6.1) (2021-04-21)
### Bug Fixes
- useUnmountEffect and useMountEffect typings fix ([32ec0c7](https://github.com/react-hookz/web/commit/32ec0c7f7b63c8d8941b95f5f8e5c369e5e87f1a))
# [1.6.0](https://github.com/react-hookz/web/compare/v1.5.0...v1.6.0) (2021-04-21)
### Features
* useToggle hook ([#3](https://github.com/react-hookz/web/issues/3)) ([3a51779](https://github.com/react-hookz/web/commit/3a51779e21c83c51994a3da59aaf88d729ecc43f))
- useToggle hook ([#3](https://github.com/react-hookz/web/issues/3)) ([3a51779](https://github.com/react-hookz/web/commit/3a51779e21c83c51994a3da59aaf88d729ecc43f))
# [1.5.0](https://github.com/react-hookz/web/compare/v1.4.3...v1.5.0) (2021-04-21)
### Features
* make tests import hooks from the index ([3210650](https://github.com/react-hookz/web/commit/3210650220f6e685d91bb7921c725596199eec84))
- make tests import hooks from the index ([3210650](https://github.com/react-hookz/web/commit/3210650220f6e685d91bb7921c725596199eec84))
## [1.4.3](https://github.com/react-hookz/web/compare/v1.4.2...v1.4.3) (2021-04-21)
### Bug Fixes
* dist package returned to bundle ([e92bd18](https://github.com/react-hookz/web/commit/e92bd18a2feafe9ae1770b992d723d31027c72d9))
- dist package returned to bundle ([e92bd18](https://github.com/react-hookz/web/commit/e92bd18a2feafe9ae1770b992d723d31027c72d9))
## [1.4.2](https://github.com/react-hookz/web/compare/v1.4.1...v1.4.2) (2021-04-18)
### Bug Fixes
* add @semantic-release/github plugin ([9f7e1b3](https://github.com/react-hookz/web/commit/9f7e1b3a441674c03ab29af3682f9619fc668806))
- add @semantic-release/github plugin ([9f7e1b3](https://github.com/react-hookz/web/commit/9f7e1b3a441674c03ab29af3682f9619fc668806))
## [1.4.1](https://github.com/react-hookz/web/compare/v1.4.0...v1.4.1) (2021-04-16)
### Bug Fixes
* add types field to package json and tweak build ([8d64b9a](https://github.com/react-hookz/web/commit/8d64b9a1e240df938f177f565c0427b9bedfe934))
- add types field to package json and tweak build ([8d64b9a](https://github.com/react-hookz/web/commit/8d64b9a1e240df938f177f565c0427b9bedfe934))
# [1.4.0](https://github.com/react-hookz/web/compare/v1.3.0...v1.4.0) (2021-04-16)
### Features
* add main file and reexport new hooks ([e2ea1cb](https://github.com/react-hookz/web/commit/e2ea1cbf6b5de909945fadde15eafd5ab70cea9f))
- add main file and reexport new hooks ([e2ea1cb](https://github.com/react-hookz/web/commit/e2ea1cbf6b5de909945fadde15eafd5ab70cea9f))
# [1.3.0](https://github.com/react-hookz/web/compare/v1.2.3...v1.3.0) (2021-04-16)
### Features
* useUpdateEffect hook ([bc3a655](https://github.com/react-hookz/web/commit/bc3a655f5cbfe3b4edb94c6084f62e95806ea6de))
- useUpdateEffect hook ([bc3a655](https://github.com/react-hookz/web/commit/bc3a655f5cbfe3b4edb94c6084f62e95806ea6de))
## [1.2.3](https://github.com/react-hookz/web/compare/v1.2.2...v1.2.3) (2021-04-16)
### Bug Fixes
* properly name useMountEffect and useUnmountEffect parameter ([5218bfc](https://github.com/react-hookz/web/commit/5218bfcc359b34fe61a46a635c41fb093182a56e))
- properly name useMountEffect and useUnmountEffect parameter ([5218bfc](https://github.com/react-hookz/web/commit/5218bfcc359b34fe61a46a635c41fb093182a56e))
## [1.2.2](https://github.com/react-hookz/web/compare/v1.2.1...v1.2.2) (2021-04-15)
### Bug Fixes
* attempt to make codecov push only occur on release publish ([ac5c221](https://github.com/react-hookz/web/commit/ac5c221659ce8173268c88d9da385411a07009f3))
- attempt to make codecov push only occur on release publish ([ac5c221](https://github.com/react-hookz/web/commit/ac5c221659ce8173268c88d9da385411a07009f3))
## [1.2.1](https://github.com/react-hookz/web/compare/v1.2.0...v1.2.1) (2021-04-15)
### Bug Fixes
* codecov push should only occur on release publish ([2a9e024](https://github.com/react-hookz/web/commit/2a9e0249d83bd7df2b126ad62e5b3aee3ca8dfbc))
- codecov push should only occur on release publish ([2a9e024](https://github.com/react-hookz/web/commit/2a9e0249d83bd7df2b126ad62e5b3aee3ca8dfbc))
# [1.2.0](https://github.com/react-hookz/web/compare/v1.1.0...v1.2.0) (2021-04-15)
### Features
* add codecov coverage reporting ([3254871](https://github.com/react-hookz/web/commit/325487121b3fb8a27ab129e31a0cec3bcf7cce1f))
- add codecov coverage reporting ([3254871](https://github.com/react-hookz/web/commit/325487121b3fb8a27ab129e31a0cec3bcf7cce1f))
# [1.1.0](https://github.com/react-hookz/web/compare/v1.0.0...v1.1.0) (2021-04-15)
### Features
* implement useMountEffect and useUnmountEffect hooks ([98ec434](https://github.com/react-hookz/web/commit/98ec434d3b9b9e56ebb92ce4bf047a2ef9d19c8f))
- implement useMountEffect and useUnmountEffect hooks ([98ec434](https://github.com/react-hookz/web/commit/98ec434d3b9b9e56ebb92ce4bf047a2ef9d19c8f))
# 1.0.0 (2021-04-14)
### Features
* add .npmignore and filler .gitignore files. ([e12375f](https://github.com/react-hookz/web/commit/e12375f2d489938e85dd7abb0fac4dae6d5be7fa))
* add CI workflow and dependabot config. ([7e365cf](https://github.com/react-hookz/web/commit/7e365cfe16fe1f7ce6c4a5792f7f490890dc14b5))
* add semantic release dep. ([4e39fa3](https://github.com/react-hookz/web/commit/4e39fa3ee5de0d7a1712601985567320a44b04c6))
* configure basic builds. ([34aafe4](https://github.com/react-hookz/web/commit/34aafe4d67ea2c27b2a321df8fed15b7e2d50bab))
* improve ci config and set initial version to 0.0.1 ([adf4dca](https://github.com/react-hookz/web/commit/adf4dca9cbd4e76ffed71fddc05d4875cb67365c))
* introduce useFirstMountState ([bd7123b](https://github.com/react-hookz/web/commit/bd7123b08dd1dd4d25ce8ae1765bfde19368a7fe))
- add .npmignore and filler .gitignore files. ([e12375f](https://github.com/react-hookz/web/commit/e12375f2d489938e85dd7abb0fac4dae6d5be7fa))
- add CI workflow and dependabot config. ([7e365cf](https://github.com/react-hookz/web/commit/7e365cfe16fe1f7ce6c4a5792f7f490890dc14b5))
- add semantic release dep. ([4e39fa3](https://github.com/react-hookz/web/commit/4e39fa3ee5de0d7a1712601985567320a44b04c6))
- configure basic builds. ([34aafe4](https://github.com/react-hookz/web/commit/34aafe4d67ea2c27b2a321df8fed15b7e2d50bab))
- improve ci config and set initial version to 0.0.1 ([adf4dca](https://github.com/react-hookz/web/commit/adf4dca9cbd4e76ffed71fddc05d4875cb67365c))
- introduce useFirstMountState ([bd7123b](https://github.com/react-hookz/web/commit/bd7123b08dd1dd4d25ce8ae1765bfde19368a7fe))
# 1.0.0 (2021-04-14)
### Features
* add .npmignore and filler .gitignore files. ([e12375f](https://github.com/react-hookz/web/commit/e12375f2d489938e85dd7abb0fac4dae6d5be7fa))
* add CI workflow and dependabot config. ([7e365cf](https://github.com/react-hookz/web/commit/7e365cfe16fe1f7ce6c4a5792f7f490890dc14b5))
* add semantic release dep. ([4e39fa3](https://github.com/react-hookz/web/commit/4e39fa3ee5de0d7a1712601985567320a44b04c6))
* configure basic builds. ([34aafe4](https://github.com/react-hookz/web/commit/34aafe4d67ea2c27b2a321df8fed15b7e2d50bab))
* improve ci config and set initial version to 0.0.1 ([adf4dca](https://github.com/react-hookz/web/commit/adf4dca9cbd4e76ffed71fddc05d4875cb67365c))
* introduce useFirstMountState ([bd7123b](https://github.com/react-hookz/web/commit/bd7123b08dd1dd4d25ce8ae1765bfde19368a7fe))
- add .npmignore and filler .gitignore files. ([e12375f](https://github.com/react-hookz/web/commit/e12375f2d489938e85dd7abb0fac4dae6d5be7fa))
- add CI workflow and dependabot config. ([7e365cf](https://github.com/react-hookz/web/commit/7e365cfe16fe1f7ce6c4a5792f7f490890dc14b5))
- add semantic release dep. ([4e39fa3](https://github.com/react-hookz/web/commit/4e39fa3ee5de0d7a1712601985567320a44b04c6))
- configure basic builds. ([34aafe4](https://github.com/react-hookz/web/commit/34aafe4d67ea2c27b2a321df8fed15b7e2d50bab))
- improve ci config and set initial version to 0.0.1 ([adf4dca](https://github.com/react-hookz/web/commit/adf4dca9cbd4e76ffed71fddc05d4875cb67365c))
- introduce useFirstMountState ([bd7123b](https://github.com/react-hookz/web/commit/bd7123b08dd1dd4d25ce8ae1765bfde19368a7fe))
# 1.0.0 (2021-04-12)
### Features
* add .npmignore and filler .gitignore files. ([e12375f](https://github.com/react-hookz/web/commit/e12375f2d489938e85dd7abb0fac4dae6d5be7fa))
* add CI workflow and dependabot config. ([7e365cf](https://github.com/react-hookz/web/commit/7e365cfe16fe1f7ce6c4a5792f7f490890dc14b5))
* add semantic release dep. ([4e39fa3](https://github.com/react-hookz/web/commit/4e39fa3ee5de0d7a1712601985567320a44b04c6))
* configure basic builds. ([34aafe4](https://github.com/react-hookz/web/commit/34aafe4d67ea2c27b2a321df8fed15b7e2d50bab))
* improve ci config and set initial version to 0.0.1 ([adf4dca](https://github.com/react-hookz/web/commit/adf4dca9cbd4e76ffed71fddc05d4875cb67365c))
* introduce useFirstMountState ([bd7123b](https://github.com/react-hookz/web/commit/bd7123b08dd1dd4d25ce8ae1765bfde19368a7fe))
- add .npmignore and filler .gitignore files. ([e12375f](https://github.com/react-hookz/web/commit/e12375f2d489938e85dd7abb0fac4dae6d5be7fa))
- add CI workflow and dependabot config. ([7e365cf](https://github.com/react-hookz/web/commit/7e365cfe16fe1f7ce6c4a5792f7f490890dc14b5))
- add semantic release dep. ([4e39fa3](https://github.com/react-hookz/web/commit/4e39fa3ee5de0d7a1712601985567320a44b04c6))
- configure basic builds. ([34aafe4](https://github.com/react-hookz/web/commit/34aafe4d67ea2c27b2a321df8fed15b7e2d50bab))
- improve ci config and set initial version to 0.0.1 ([adf4dca](https://github.com/react-hookz/web/commit/adf4dca9cbd4e76ffed71fddc05d4875cb67365c))
- introduce useFirstMountState ([bd7123b](https://github.com/react-hookz/web/commit/bd7123b08dd1dd4d25ce8ae1765bfde19368a7fe))
{
"name": "@react-hookz/web",
"version": "1.6.2",
"version": "1.7.1",
"description": "React hooks done right, for browser and SSR.",
"keywords": [
"react",
"hook",
"react-hook",
"browser",
"ssr"
],
"license": "MIT",

@@ -16,21 +24,27 @@ "repository": {

"files": [
"dist"
"cjs",
"esm",
"esnext",
"types"
],
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "cjs/index.js",
"types": "types/index.d.ts",
"esnext": "esm/index.js",
"scripts": {
"build": "yarn build:cleanup && yarn build:tsc",
"build:cleanup": "rimraf ./dist",
"build:tsc": "tsc -p ./tsconfig.build.json",
"build": "yarn build:cleanup && yarn build:cjs && yarn build:esm && yarn build:esnext",
"build:cleanup": "rimraf ./cjs ./esm ./esnext ./types",
"build:cjs": "tsc -p ./tsconfig.build.json --module CommonJS --target ES5 --outDir ./cjs",
"build:esm": "tsc -p ./tsconfig.build.json --module ES6 --target ES5 --outDir ./esm",
"build:esnext": "tsc -p ./tsconfig.build.json --module ESNext --target ESNext --outDir ./esnext --declaration --declarationDir ./types",
"test": "jest",
"test:coverage": "yarn test --coverage",
"lint": "eslint ./ ./.storybook --ext ts,js,tsx,jsx",
"lint": "eslint ./ ./.storybook --ext ts,js,tsx,jsx,md,mdx",
"lint:fix": "yarn lint --fix",
"prepare": "husky install",
"storybook:watch": "start-storybook -p 6006",
"storybook:build": "build-storybook -o ./storybook-build",
"storybook:watch": "start-storybook -p 6006 --docs",
"storybook:build": "build-storybook --docs -o ./storybook-build",
"storybook:deploy": "storybook-to-ghpages -s storybook:build"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": "eslint --fix"
"*.{js,jsx,ts,tsx,md,mdx}": "eslint --fix"
},

@@ -66,9 +80,9 @@ "commitlint": {

"@semantic-release/github": "^7.2.1",
"@storybook/addon-essentials": "^6.2.8",
"@storybook/addon-links": "^6.2.8",
"@storybook/addon-essentials": "^6.2.9",
"@storybook/addon-links": "^6.2.9",
"@storybook/addons": "^6.2.8",
"@storybook/react": "^6.2.8",
"@storybook/react": "^6.2.9",
"@storybook/storybook-deployer": "^2.8.7",
"@storybook/theming": "^6.2.8",
"@testing-library/react-hooks": "^5.1.1",
"@storybook/theming": "^6.2.9",
"@testing-library/react-hooks": "^5.1.2",
"@types/jest": "^26.0.22",

@@ -85,4 +99,5 @@ "@typescript-eslint/eslint-plugin": "^4.22.0",

"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-mdx": "^1.12.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.23.2",

@@ -98,3 +113,3 @@ "eslint-plugin-react-hooks": "^4.2.0",

"semantic-release": "^17.4.2",
"ts-jest": "^26.5.4",
"ts-jest": "^26.5.5",
"ts-node": "^9.1.1",

@@ -101,0 +116,0 @@ "typescript": "^4.2.4",

@@ -1,29 +0,56 @@

<div align="center">
<h1><img src=".github/logo.png" alt="@react-hookz/web"></h1>
<p>
<a href="https://www.npmjs.com/package/@react-hookz/web">
<img src="https://flat.badgen.net/npm/v/@react-hookz/web" alt="NPM Version">
</a>
<a href="https://www.npmjs.com/package/@react-hookz/web">
<img src="https://flat.badgen.net/npm/dm/@react-hookz/web" alt="NPM Downloads">
</a>
<a href="https://www.npmjs.com/package/@react-hookz/web">
<img src="https://flat.badgen.net/npm/dependents/@react-hookz/web" alt="NPM Dependents">
</a>
<a href="https://github.com/react-hookz/web/actions">
<img src="https://img.shields.io/github/workflow/status/react-hookz/web/CI?style=flat-square" alt="Build">
</a>
<a href="https://app.codecov.io/gh/react-hookz/web">
<img src="https://flat.badgen.net/codecov/c/github/react-hookz/web" alt="Coverage">
</a>
<a href="https://bundlephobia.com/result?p=@react-hookz/web">
<img src="https://flat.badgen.net/bundlephobia/minzip/@react-hookz/web" alt="Minified bundle size">
</a>
<a href="https://bundlephobia.com/result?p=@react-hookz/web">
<img src="https://flat.badgen.net/bundlephobia/tree-shaking/@react-hookz/web" alt="Tree shaking">
</a>
</p>
</div>
# ![@react-hookz/web](.github/logo.png)
React hooks done right, for browser and SSR.
[![NPM Version](https://flat.badgen.net/npm/v/@react-hookz/web)](https://www.npmjs.com/package/@react-hookz/web)
[![NPM Downloads](https://flat.badgen.net/npm/dm/@react-hookz/web)](https://www.npmjs.com/package/@react-hookz/web)
[![NPM Dependents](https://flat.badgen.net/npm/dependents/@react-hookz/web)](https://www.npmjs.com/package/@react-hookz/web)
[![Build](https://img.shields.io/github/workflow/status/react-hookz/web/CI?style=flat-square)](https://github.com/react-hookz/web/actions)
[![Coverage](https://flat.badgen.net/codecov/c/github/react-hookz/web)](https://app.codecov.io/gh/react-hookz/web)
[![Types](https://flat.badgen.net/npm/types/@react-hookz/web)](https://www.npmjs.com/package/@react-hookz/web)
`@react-hookz/web` is a library of general-purpose React hooks built with care and SSR compatibility
in mind.
## Install
This one is pretty simple, everyone knows what to do:
```shell
npm i @react-hookz/web
# or
yarn add @react-hookz/web
```
As hooks been introduced to the world in React 16.8 `@react-hookz/web` has requires, you gessed
it, `react` and `react-dom` 16.8+.
Also, as React does not support IE, `@react-hookz/web` does not do that either. You'll have to
transpile your `node-modules` in order to run in IE.
## Usage
This package provides three levels of compilation:
1. **Main**, the `/cjs` folder — CommonJS modules, with ES5 lang level.
2. **ESM**, the `/esm` folder — it is ES modules, with ES5 lang level.
3. **ESNext**, the `/esnext` folder — it is ES modules, with ESNext lang level.
So, if you need `useMountEffect` hook, depending on your needs, you can import in three ways (
actually there is more, but in common it is three):
```ts
// in case you need cjs modules
import { useMountEffect } from "@react-hookz/web";
// in case you need esm modules
import { useMountEffect } from "@react-hookz/web/esm";
// in case you want all the recent ES features
import { useMountEffect } from "@react-hookz/web/esnext";
```
## Hooks list
- #### Lifecycle hooks
- `useUpdateEffect` - Effect hook that ignores the first render (not invoked on mount).
- [`useFirstMountState`](https://react-hookz.github.io/web/?path=/docs/lifecycle-usefirstmountstate)
— Return boolean that is `true` only on first render.
- [`useUpdateEffect`](https://react-hookz.github.io/web/?path=/docs/lifecycle-useupdateeffect)
— Effect hook that ignores the first render (not invoked on mount).
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc