Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
7a2fc18
Fixes possible typo in example
schalkventer Oct 10, 2023
d770587
fix: correct peer dependencies
streamich Dec 1, 2023
e27c193
chore(release): 17.4.2 [skip ci]
semantic-release-bot Dec 1, 2023
5aa8436
Add clear() to useSet
suisous Jan 5, 2024
d4e671d
Update useSet docs
suisous Jan 5, 2024
a6bc119
Update test of useSet
suisous Jan 5, 2024
e7379f0
fix: update useMedia hook to use recommended approach of MDN
willnguyen1312 Jan 10, 2024
3264d96
Merge pull request #2536 from willnguyen1312/pr/update-use-media
streamich Jan 13, 2024
ea688b0
chore(release): 17.4.3 [skip ci]
semantic-release-bot Jan 13, 2024
06afdf7
Merge pull request #2535 from suisous/pr/suisous
streamich Jan 15, 2024
0534648
fix: typo in example
streamich Jan 21, 2024
82146f6
chore(release): 17.4.4 [skip ci]
semantic-release-bot Jan 21, 2024
75218e4
feat(pencil): add isFirst and isLast return value to 'useStateList'
AlexandreT-DevId Jan 22, 2024
6a9dde5
feat(pencil): fix with yarn lint:fix
AlexandreT-DevId Jan 22, 2024
ac64414
feat: add `isFirst` and `isLast` methods to `useStateList` hook
streamich Jan 22, 2024
ade8d39
chore(release): 17.5.0 [skip ci]
semantic-release-bot Jan 22, 2024
adfb337
fix: 🐛 bump nano-css dependency
streamich Jul 20, 2024
41b8ec3
ci: 🎡 remove CircleCI config
streamich Jul 20, 2024
b200db9
ci: 🎡 update Node.js versions
streamich Jul 20, 2024
7b1ab19
chore(release): 17.5.1 [skip ci]
semantic-release-bot Jul 20, 2024
e14d092
ci: 🎡 add mirror workflow
streamich Jul 20, 2024
5b5d163
ci: 🎡 pause Storybook workflow
streamich Jul 20, 2024
8e80884
ci: 🎡 bump node versions
streamich Jul 20, 2024
8bc66ea
ci: 🎡 add release workflow
streamich Jul 20, 2024
b6e63b5
Merge pull request #2569 from streamich/ci
streamich Jul 20, 2024
ba24999
chore(deps): update dependency gh-pages to v5 [security]
renovate[bot] Jul 20, 2024
f68238f
chore(deps): update dependency semantic-release to v19 [security]
renovate[bot] Jul 20, 2024
38255b3
chore(deps): update dependency @storybook/addon-knobs to v6.4.0
renovate[bot] Jul 20, 2024
b54ab2b
chore(deps): update dependency fork-ts-checker-webpack-plugin to v6.5.3
renovate[bot] Jul 20, 2024
3fca48b
chore(deps): update dependency jest-localstorage-mock to v2.4.26
renovate[bot] Jul 20, 2024
05dc927
chore(deps): update dependency react-frame-component to v5.2.7
renovate[bot] Jul 21, 2024
918b3db
chore(deps): update dependency semantic-release to v19.0.5
renovate[bot] Jul 21, 2024
601c3ca
chore(deps): update dependency ts-node to v10.9.2
renovate[bot] Jul 21, 2024
6c9f508
chore(deps): update node.js to v14.21.3
renovate[bot] Jul 21, 2024
2d5e2da
chore(deps): update semantic-release monorepo
renovate[bot] Jul 21, 2024
bf8f93b
chore(deps): update yarn to v1.22.22
renovate[bot] Jul 21, 2024
3baa63b
chore(deps): update babel monorepo
renovate[bot] Jul 21, 2024
6988a4e
chore(deps): update dependency eslint to v8.57.0
renovate[bot] Jul 21, 2024
781bbc2
chore(deps): update dependency eslint-config-prettier to v8.10.0
renovate[bot] Jul 22, 2024
388fa58
chore(deps): update dependency eslint-plugin-import to v2.29.1
renovate[bot] Jul 22, 2024
d5654eb
chore(deps): update dependency eslint-plugin-jsx-a11y to v6.9.0
renovate[bot] Jul 22, 2024
a202826
chore(deps): update dependency eslint-plugin-react to v7.35.0
renovate[bot] Jul 22, 2024
e1aff11
chore(deps): update dependency react-spring to v9.7.4
renovate[bot] Jul 22, 2024
1365221
chore(deps): update dependency rxjs to v7.8.1
renovate[bot] Jul 22, 2024
e1d0cd9
chore(deps): update typescript-eslint monorepo to v5.62.0
renovate[bot] Jul 22, 2024
3eb531a
feat: add onChange callback to useWindowSize
mahmoud-elgammal Dec 2, 2024
ea656f7
feat: add onChange callback to useWindowSize
mahmoud-elgammal Dec 2, 2024
7c4d696
docs: add security policy
streamich Dec 9, 2024
7602956
Merge pull request #2608 from mahmoud-elgammal/feature/useWindowSize-…
streamich Dec 9, 2024
ad33f76
chore(release): 17.6.0 [skip ci]
semantic-release-bot Dec 9, 2024
bdc0f79
Merge remote-tracking branch 'streamich/master' into update-fork-17-6-0
reckter Jul 7, 2025
36a5342
Fix useHoverDirty with react 19
reckter Jul 7, 2025
393eb78
Merge branch 'main' into update-fork-17-6-0
reckter Jul 7, 2025
c002110
Update auto to v11
reckter Jul 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 0 additions & 141 deletions .circleci/config.yml

This file was deleted.

37 changes: 17 additions & 20 deletions .github/workflows/check-codebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,31 @@ jobs:
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 14
node-version: 20

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run build
run: yarn build

storybook:
name: Storybook
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
# storybook:
# name: Storybook
# runs-on: ubuntu-latest
# steps:
# - name: Check out repository
# uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 14
# - name: Setup node
# uses: actions/setup-node@v1
# with:
# node-version: 20

- name: Install dependencies
run: yarn install --frozen-lockfile
# - name: Install dependencies
# run: yarn install --frozen-lockfile

- name: Run build:storybook
run: yarn storybook:build
# - name: Run build:storybook
# run: yarn storybook:build

lint:
name: Linting
Expand All @@ -55,7 +55,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 14
node-version: 20

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand All @@ -73,10 +73,7 @@ jobs:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
node: [12, 14, 16]
exclude:
- os: macos-latest
node: 12
node: [20, 22]
steps:
- name: Check out repository
uses: actions/checkout@v2
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Node.js CI

on:
push:
branches: [master]

jobs:
mirror:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Push To Gitlab
env:
token: ${{ secrets.GITLAB_TOKEN }}
run: |
git config user.name "streamich"
git config user.email "react-use+streamich@users.noreply.github.com"
git remote add mirror "https://oauth2:${token}@gitlab.com/streamich/react-use.git"
git push mirror master
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Node.js CI

on:
push:
branches: [master, next]

jobs:
release:
if: ${{ github.event_name == 'push' && (github.event.ref == 'refs/heads/master' || github.event.ref == 'refs/heads/next') }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn test
- run: yarn lint:types
- run: yarn build
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,61 @@
# [17.6.0](https://github.com/streamich/react-use/compare/v17.5.1...v17.6.0) (2024-12-09)


### Features

* add onChange callback to useWindowSize ([ea656f7](https://github.com/streamich/react-use/commit/ea656f7e751b8366360ce2aa8238057bbbc1251a))
* add onChange callback to useWindowSize ([3eb531a](https://github.com/streamich/react-use/commit/3eb531ac9e9e04641df29aafbd2677869cdcb085))

## [17.5.1](https://github.com/streamich/react-use/compare/v17.5.0...v17.5.1) (2024-07-20)


### Bug Fixes

* 🐛 bump nano-css dependency ([adfb337](https://github.com/streamich/react-use/commit/adfb337d5b11427798afc5a21c6ebdaa76212182))

# [17.5.0](https://github.com/streamich/react-use/compare/v17.4.4...v17.5.0) (2024-01-22)


### Features

* add `isFirst` and `isLast` methods to `useStateList` hook ([ac64414](https://github.com/streamich/react-use/commit/ac64414bea4c8afadfb382da9fea44ee89b41e2d))
* **pencil:** add isFirst and isLast return value to 'useStateList' ([75218e4](https://github.com/streamich/react-use/commit/75218e45dfdcdc6ea193e278cb97ceee98c00f1b))
* **pencil:** fix with yarn lint:fix ([6a9dde5](https://github.com/streamich/react-use/commit/6a9dde596ae25c0dd2fa97b0cf354143fbc5b5ff))

## [17.4.4](https://github.com/streamich/react-use/compare/v17.4.3...v17.4.4) (2024-01-21)


### Bug Fixes

* typo in example ([0534648](https://github.com/streamich/react-use/commit/05346481a15a321b13838eead0bda3024b0d163f))

## [17.4.3](https://github.com/streamich/react-use/compare/v17.4.2...v17.4.3) (2024-01-13)


### Bug Fixes

* update useMedia hook to use recommended approach of MDN ([e7379f0](https://github.com/streamich/react-use/commit/e7379f088787cbf9274c1fc21d36061f04855e4c))

## [17.4.2](https://github.com/streamich/react-use/compare/v17.4.1...v17.4.2) (2023-12-01)


### Bug Fixes

* correct peer dependencies ([d770587](https://github.com/streamich/react-use/commit/d77058729654397b68b251e8211bf0edc0b4ed50))

## [17.4.1](https://github.com/streamich/react-use/compare/v17.4.0...v17.4.1) (2023-11-28)
# v17.5.7 (Thu Aug 04 2022)

#### 🐛 Bug Fix

- :wrench: [#5](https://github.com/opencreek/react-use/pull/5) ([@reckter](https://github.com/reckter))

#### Authors: 1

- Hannes Güdelhöfer ([@reckter](https://github.com/reckter))

---

# v17.5.7 (Thu Aug 04 2022)

#### 🐛 Bug Fix
Expand Down
13 changes: 13 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Security Policy

## Supported Versions

We release patches for security vulnerabilities. The latest major version
will support security patches.

## Reporting a Vulnerability

Please report (suspected) security vulnerabilities to
**[streamich@gmail.com](mailto:streamich@gmail.com)**. We will try to respond
within 48 hours. If the issue is confirmed, we will release a patch as soon
as possible depending on complexity.
8 changes: 7 additions & 1 deletion docs/useSet.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@ React state hook that tracks a [Set](https://developer.mozilla.org/en-US/docs/We

## Usage

What is the difference between the "clear()" method and the "reset()" method?

The "reset()" method returns the "Set" to the initial value passed during "useSet
The "clear()" method completely empties the "Set".

```jsx
import {useSet} from 'react-use';

const Demo = () => {
const [set, { add, has, remove, toggle, reset }] = useSet(new Set(['hello']));
const [set, { add, has, remove, toggle, reset, clear }] = useSet(new Set(['hello']));

return (
<div>
<button onClick={() => add(String(Date.now()))}>Add</button>
<button onClick={() => reset()}>Reset</button>
<button onClick={() => clear()}>Clear</button>
<button onClick={() => remove('hello')} disabled={!has('hello')}>
Remove 'hello'
</button>
Expand Down
2 changes: 1 addition & 1 deletion docs/useSlider.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Demo = () => {
<div>
<div ref={ref} style={{ position: 'relative' }}>
<p style={{ textAlign: 'center', color: isSliding ? 'red' : 'green' }}>
{Math.round(state.value * 100)}%
{Math.round(value * 100)}%
</p>
<div style={{ position: 'absolute', left: pos }}>🎚</div>
</div>
Expand Down
Loading
Loading