Skip to content

Commit

Permalink
fix: fix the buy that if initialStay is true, shouldStay is always …
Browse files Browse the repository at this point in the history
…true
  • Loading branch information
shlroland committed Sep 13, 2024
1 parent 93ebf10 commit 41dd4ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-stay-at-bottom",
"type": "module",
"version": "0.0.3",
"version": "1.0.0",
"packageManager": "[email protected]",
"description": "A React hook that keeps a scrollable element at the bottom.",
"author": "shlroland <[email protected]>",
Expand Down
4 changes: 3 additions & 1 deletion src/use-stay-at-bottom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ export function useStayAtBottom(

useIsomorphicLayoutEffect(() => {
if (initialStay) {
stayAtBottom()
if (autoStay) {
stayAtBottom()
}
scrollToBottom()
}
}, [])
Expand Down

0 comments on commit 41dd4ca

Please sign in to comment.