Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit 1f4d25b

Browse files
committed
useHashScroll demo added and ChildrenHash warning fixed
1 parent 15ba99c commit 1f4d25b

File tree

7 files changed

+37
-14
lines changed

7 files changed

+37
-14
lines changed

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"@typescript-eslint/no-explicit-any": "off",
3434
"no-constant-condition": ["error", { "checkLoops": false }],
3535
"react-hooks/rules-of-hooks": "error",
36-
"react-hooks/exhaustive-deps": "warn"
36+
"react-hooks/exhaustive-deps": "warn",
37+
"tsdoc/syntax": "warn"
3738
}
3839
}

.github/workflows/firebase-hosting-merge.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
push:
88
paths:
99
- "website/**"
10-
- "docs/**"
1110
branches:
1211
- "main"
1312

CHANGELOG.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,53 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/), and this
77
**Table of Contents**
88

99
- [[Unreleased]](#unreleased)
10-
- [[v1.4.0] - (2020-12-03)](#v140---2020-12-03)
10+
- [[v1.4.1] - (2020-12-03)](#v141---2020-12-03)
1111
- [Added](#added)
12-
- [[v1.3.2] - (2020-12-02)](#v132---2020-12-02)
12+
- [Fixed](#fixed)
13+
- [[v1.4.0] - (2020-12-03)](#v140---2020-12-03)
1314
- [Added](#added-1)
14-
- [[v1.3.1] - (2020-11-30)](#v131---2020-11-30)
15+
- [[v1.3.2] - (2020-12-02)](#v132---2020-12-02)
1516
- [Added](#added-2)
16-
- [[v1.3.0] - (2020-11-27)](#v130---2020-11-27)
17+
- [[v1.3.1] - (2020-11-30)](#v131---2020-11-30)
1718
- [Added](#added-3)
19+
- [[v1.3.0] - (2020-11-27)](#v130---2020-11-27)
20+
- [Added](#added-4)
1821
- [Dependencies](#dependencies)
1922
- [[v1.2.3] - (2020-11-26)](#v123---2020-11-26)
2023
- [Removed](#removed)
2124
- [[v1.2.2] - (2020-11-26)](#v122---2020-11-26)
22-
- [Fixed](#fixed)
23-
- [[v1.2.1] - (2020-11-26)](#v121---2020-11-26)
2425
- [Fixed](#fixed-1)
26+
- [[v1.2.1] - (2020-11-26)](#v121---2020-11-26)
27+
- [Fixed](#fixed-2)
2528
- [[v1.2.0] - (2020-11-26)](#v120---2020-11-26)
26-
- [Added](#added-4)
29+
- [Added](#added-5)
2730
- [Changed](#changed)
2831
- [[v1.1.0] - (2020-11-24)](#v110---2020-11-24)
29-
- [Added](#added-5)
32+
- [Added](#added-6)
3033
- [Changed](#changed-1)
3134
- [[v1.0.2] - (2020-11-23)](#v102---2020-11-23)
3235
- [Changed](#changed-2)
3336
- [[1.0.1] - (2020-11-23)](#101---2020-11-23)
34-
- [Added](#added-6)
35-
- [Fixed](#fixed-2)
37+
- [Added](#added-7)
38+
- [Fixed](#fixed-3)
3639
- [[1.0.0] - (2020-11-23)](#100---2020-11-23)
3740

3841
## [Unreleased]
3942

4043
---
4144

45+
## [v1.4.1] - (2020-12-03)
46+
47+
### Added
48+
49+
- useHashScroll demo
50+
51+
### Fixed
52+
53+
- ChildrenHash logging warning inaccurately
54+
55+
---
56+
4257
## [v1.4.0] - (2020-12-03)
4358

4459
### Added

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,10 @@ const App = () => {
303303

304304
Creates a ref that scrolls to its assigned element when a specified hash is present in the url
305305

306+
#### Demo
307+
308+
[![View useHashScroll Demo](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-hash-scroll-demos-ge3b4?initialpath=use-hash-scroll&module=/src/Demos/UseHashScrollDemo.tsx)
309+
306310
#### Params
307311

308312
`hash`

docs/Hooks/useHashScroll.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
Creates a ref that scrolls to its assigned element when a specified hash is present in the url
66

7+
#### Demo
8+
9+
[![View useHashScroll Demo](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-hash-scroll-demos-ge3b4?initialpath=use-hash-scroll&module=/src/Demos/UseHashScrollDemo.tsx)
10+
711
#### Params
812

913
`hash`

src/Components/ChildrenHash.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const ChildrenHash: FC<ChildrenHashProps> = ({
5757
requiredPathname,
5858
scrollFunc,
5959
}) => {
60-
warning(hashes.length !== children.length, CHILDREN_HASH_UNEQUAL_LENGTHS);
60+
warning(hashes.length === children.length, CHILDREN_HASH_UNEQUAL_LENGTHS);
6161
return (
6262
<>
6363
{children.map((child, i) => (

src/Utils/messages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export const CHILDREN_HASH_UNEQUAL_LENGTHS =
2-
"The number of hashes and children should be the same so that each child corresponds to a hash";
2+
"The number of hashes and children should be the same so that each child corresponds to a hash (ChildrenHash) - React Hash Scroll";

0 commit comments

Comments
 (0)