Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discord fork v5 #17

Draft
wants to merge 58 commits into
base: discord-fork-4.6.1
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
6a4d296
feat: rewrite gesture apis with gesture handler 2 (#1126)
gorhom Oct 3, 2022
a1ec74d
fix(#1119): fixed race condition between onmount and keyboard animations
gorhom Oct 3, 2022
a996b4a
feat: added web support (#1150)
gorhom Feb 19, 2023
4829316
chore: updated reanimated to v3 (#1324)
gorhom Mar 18, 2023
57f8067
chore: release v5.0.0-alpha.0
gorhom Mar 18, 2023
1d1a464
fix: fixed keyboard dismissing issue with Reanimated v3 (#1346)(by @j…
janicduplessis Apr 30, 2023
b440964
chore: fixed types (#1123)(by @stropho)
stropho Apr 30, 2023
e42fafc
fix(BottomSheetScrollView): updated scroll responders props type (#13…
eps1lon Apr 30, 2023
9c1605a
chore: release v5.0.0-alpha.1
gorhom Apr 30, 2023
3ccbefc
fix: crash on swipe down (#1367)(by @beqramo)
gorhom Jun 4, 2023
949d9de
chore: release v5.0.0-alpha.2
gorhom Jun 4, 2023
549e461
chore: updated react native and other deps (#1412)
gorhom Jun 23, 2023
630f87f
fix: updated scrollables mocks with ReactNative list equivalent (#139…
gkueny Jun 23, 2023
67e1e09
fix(bottom-sheet-modal): added container component prop to modal (#13…
magrinj Jun 23, 2023
1f69625
fix: resume close animation when container gets resized (#1374) (#1392)
gorhom Jun 4, 2023
a1dda71
chore: release v5.0.0-alpha.3
gorhom Jun 25, 2023
f6f2304
chore: updated expo and react native deps (#1445)
gorhom Jul 15, 2023
b81cb93
fix: updated containerOffset top value to default to 0 (#1420)(by @be…
beqramo Jul 15, 2023
81cd66f
fix(BottomSheetTextInput): reset shouldHandleKeyboardEvents on unmoun…
koplyarov Sep 6, 2023
e190f4e
chore: release v5.0.0-alpha.4
gorhom Sep 6, 2023
129611f
chore: updated examples to use expo only (#1668)
gorhom Dec 23, 2023
f0ec705
fix: fixed position x index sequencing with container resizing (#1675)
gorhom Jan 1, 2024
d6e3dc9
fix(web): use absolute positioning for BottomSheetContainer in web (#…
viljark Jan 1, 2024
227d7d9
chore: updated typescript
gorhom Jan 1, 2024
f7af53d
chore: updated example app background colour
gorhom Jan 3, 2024
8017fb6
feat: added default dynamic sizing (#1513)(with @Eli-Nathan & @ororsa…
gorhom Jan 3, 2024
57c196c
fix: allowed content max height be applied for dynamic sizing
gorhom Jan 3, 2024
95f0cbc
chore: updated examples
gorhom Jan 3, 2024
17269f1
fix: dismiss all action for modals (#1529)(by @david-gomes5)
david-gomes5 Sep 17, 2023
6203c18
feat: added accessibility overrides support (#1288)(by @Mahmoud-SK)
gorhom Jan 3, 2024
d746d85
fix: prevent updating backdrop state when unmounting (#1657)(by @chri…
gorhom Jan 3, 2024
d9bb26e
chore: updated release-it
gorhom Jan 3, 2024
96b9088
chore: release v5.0.0-alpha.5
gorhom Jan 3, 2024
b0792de
fix: fixed the backdrop tap gesture on web (#1446)
gorhom Jan 3, 2024
9475a7e
chore: release v5.0.0-alpha.6
gorhom Jan 3, 2024
d620494
fix: added support for web without Babel/SWC (#1741)(by @joshsmith)
joshsmith Feb 18, 2024
67bc067
chore: updated expo to v50
gorhom Feb 18, 2024
317ff45
docs: updated documentation link
gorhom Feb 18, 2024
dee95e5
fix: added BottomSheetTextInput to the mock file (#1698)(by @ghorbani-m)
gorhom Feb 18, 2024
a6f44c0
fix: added missing mock of Touchables (#1700)(by @jaworek)
gorhom Feb 18, 2024
5009085
fix: added footer height to content height when using dynamic sizing …
gorhom Feb 18, 2024
8255af6
chore: release v5.0.0-alpha.7
gorhom Feb 18, 2024
6efd8ae
fix: fixed the mount animation with reduce motion enabled (#1560, #1674)
gorhom Feb 25, 2024
8b62dca
fix: added error message when dynamic sizing enabled with a wrong chi…
gorhom Feb 25, 2024
9b4ef4d
fix: bottom sheet not appearing for users that have reduced motion tu…
fobos531 Feb 26, 2024
88f81a3
chore: updated animate method parameter default value
gorhom Feb 26, 2024
bf094c8
chore: fixed typescript issue with external interfaces
gorhom Feb 26, 2024
8b2b618
chore: release v5.0.0-alpha.8
gorhom Feb 26, 2024
2784fa1
revert: updated animate method parameter default value (#1757)(by @je…
jeongshin Feb 27, 2024
330c286
chore: release v5.0.0-alpha.9
gorhom Feb 27, 2024
58f2335
Discord fork
yayvery Nov 13, 2023
f5369cd
bring back provided contentHeight and handleHeight, and disable defau…
yayvery Mar 14, 2024
b16f12b
add eslint plugin for no reanimated hook deps
yayvery Mar 14, 2024
2cc0b9c
fix type imports
yayvery Mar 14, 2024
44aff08
fix reanimated deps eslint errors
yayvery Mar 14, 2024
5dd6f62
remove deprecated reanimated apis/types
yayvery Mar 14, 2024
029fcf1
roundToNearestPixel in normalizeSnapPoint
yayvery Mar 15, 2024
6c6713b
partially resolve android keyboard bug
yayvery Mar 15, 2024
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
9 changes: 8 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
module.exports = {
root: true,
extends: ['@react-native-community', 'prettier'],
extends: ['@react-native', 'prettier'],
plugins: ['bottom-sheet'],
rules: {
'no-console': ['error', { allow: ['warn', 'error'] }],
'prettier/prettier': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': [
'error',
{ additionalHooks: 'useWorkletCallback' },
],
'bottom-sheet/no-reanimated-hook-deps': 'error',
},
};
1 change: 0 additions & 1 deletion .huskyrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
}
}
12 changes: 4 additions & 8 deletions .release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@
"git": {
"push": true,
"tagName": "v${version}",
"commitMessage": "chore: release v${version}",
"changelog": "auto-changelog --stdout --unreleased --template ./templates/changelog-template.hbs"
"commitMessage": "chore: release v${version}"
},
"github": {
"release": true,
"releaseNotes": "auto-changelog --stdout --unreleased --template ./templates/release-template.hbs"
"release": true
},
"npm": {
"publish": false
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": "angular"
"preset": "angular",
"infile": "CHANGELOG.md"
}
},
"hooks": {
"after:bump": "auto-changelog -p --template ./templates/changelog-template.hbs"
}
}
139 changes: 137 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,141 @@


# [5.0.0-alpha.9](https://github.com/gorhom/react-native-bottom-sheet/compare/v5.0.0-alpha.8...v5.0.0-alpha.9) (2024-02-27)


### Reverts

* updated animate method parameter default value ([#1757](https://github.com/gorhom/react-native-bottom-sheet/issues/1757))(by [@jeongshin](https://github.com/jeongshin)) ([2784fa1](https://github.com/gorhom/react-native-bottom-sheet/commit/2784fa1415d461fd761f2bf29610bcbae1e0f8bb))

# [5.0.0-alpha.8](https://github.com/gorhom/react-native-bottom-sheet/compare/v5.0.0-alpha.7...v5.0.0-alpha.8) (2024-02-26)


### Bug Fixes

* added error message when dynamic sizing enabled with a wrong children type ([8b62dca](https://github.com/gorhom/react-native-bottom-sheet/commit/8b62dca06752a3c047162a693a75173a7c701e3e))
* bottom sheet not appearing for users that have reduced motion turned on ([#1743](https://github.com/gorhom/react-native-bottom-sheet/issues/1743))(by [@fobos531](https://github.com/fobos531)) ([9b4ef4d](https://github.com/gorhom/react-native-bottom-sheet/commit/9b4ef4dabb7ce1f846ae90e2bab39fa9354ff125))
* fixed the mount animation with reduce motion enabled ([#1560](https://github.com/gorhom/react-native-bottom-sheet/issues/1560), [#1674](https://github.com/gorhom/react-native-bottom-sheet/issues/1674)) ([6efd8ae](https://github.com/gorhom/react-native-bottom-sheet/commit/6efd8aeb0e312555fa77609869eedbf46a4a04b3))

# [5.0.0-alpha.7](https://github.com/gorhom/react-native-bottom-sheet/compare/v5.0.0-alpha.6...v5.0.0-alpha.7) (2024-02-18)


### Bug Fixes

* added BottomSheetTextInput to the mock file ([#1698](https://github.com/gorhom/react-native-bottom-sheet/issues/1698))(by [@ghorbani-m](https://github.com/ghorbani-m)) ([dee95e5](https://github.com/gorhom/react-native-bottom-sheet/commit/dee95e5b161d78b0aae34d85abea3d8042417892))
* added footer height to content height when using dynamic sizing ([#1725](https://github.com/gorhom/react-native-bottom-sheet/issues/1725)) ([5009085](https://github.com/gorhom/react-native-bottom-sheet/commit/50090859f9e50932c641df5b0d6f91cc9f3b5bad))
* added missing mock of Touchables ([#1700](https://github.com/gorhom/react-native-bottom-sheet/issues/1700))(by [@jaworek](https://github.com/jaworek)) ([a6f44c0](https://github.com/gorhom/react-native-bottom-sheet/commit/a6f44c01ef8f1b9154ce2313614daf075567f641))
* added support for web without Babel/SWC ([#1741](https://github.com/gorhom/react-native-bottom-sheet/issues/1741))(by [@joshsmith](https://github.com/joshsmith)) ([d620494](https://github.com/gorhom/react-native-bottom-sheet/commit/d620494877e98f4331d8c0a1cb7d375abb06db60))

# [5.0.0-alpha.6](https://github.com/gorhom/react-native-bottom-sheet/compare/v5.0.0-alpha.5...v5.0.0-alpha.6) (2024-01-03)


### Bug Fixes

* fixed the backdrop tap gesture on web ([#1446](https://github.com/gorhom/react-native-bottom-sheet/issues/1446)) ([b0792de](https://github.com/gorhom/react-native-bottom-sheet/commit/b0792dea5ec605b449d40037cbecfd35bf0ff066))

# [5.0.0-alpha.5](https://github.com/gorhom/react-native-bottom-sheet/compare/v5.0.0-alpha.4...v5.0.0-alpha.5) (2024-01-03)


### Bug Fixes

* allowed content max height be applied for dynamic sizing ([57c196c](https://github.com/gorhom/react-native-bottom-sheet/commit/57c196cfdf2f63622fb5ea8d6d32cf21b9dd9367))
* dismiss all action for modals ([#1529](https://github.com/gorhom/react-native-bottom-sheet/issues/1529))(by [@david-gomes5](https://github.com/david-gomes5)) ([17269f1](https://github.com/gorhom/react-native-bottom-sheet/commit/17269f1f55b91f33cec24870ebe00f2510888a4b))
* fixed position x index sequencing with container resizing ([#1675](https://github.com/gorhom/react-native-bottom-sheet/issues/1675)) ([f0ec705](https://github.com/gorhom/react-native-bottom-sheet/commit/f0ec705cd74ea6e31614ab12c0b4fdc097d3820d))
* prevent updating backdrop state when unmounting ([#1657](https://github.com/gorhom/react-native-bottom-sheet/issues/1657))(by [@christophby](https://github.com/christophby)) ([d746d85](https://github.com/gorhom/react-native-bottom-sheet/commit/d746d85b92e2bdb4351ea4d3fde140e3199ac671))
* **web:** use absolute positioning for BottomSheetContainer in web ([#1597](https://github.com/gorhom/react-native-bottom-sheet/issues/1597)) ([d6e3dc9](https://github.com/gorhom/react-native-bottom-sheet/commit/d6e3dc9b327b840895c875dcf016fb5c80a62915))


### Features

* added accessibility overrides support ([#1288](https://github.com/gorhom/react-native-bottom-sheet/issues/1288))(by @Mahmoud-SK) ([6203c18](https://github.com/gorhom/react-native-bottom-sheet/commit/6203c18acc9f8dc3a31af5bf5ad80e368deceb52))
* added default dynamic sizing ([#1513](https://github.com/gorhom/react-native-bottom-sheet/issues/1513))(with @Eli-Nathan & [@ororsatti](https://github.com/ororsatti)) ([#1683](https://github.com/gorhom/react-native-bottom-sheet/issues/1683)) ([8017fb6](https://github.com/gorhom/react-native-bottom-sheet/commit/8017fb6b02088d3c66c64a8a23e0f63f22884d36))

## Changelog

### [v4.4.5](https://github.com/gorhom/react-native-bottom-sheet/compare/v4.4.4...v4.4.5) -
### [v5.0.0-alpha.4](https://github.com/gorhom/react-native-bottom-sheet/compare/v5.0.0-alpha.3...v5.0.0-alpha.4) -

#### Fixes

- (BottomSheetTextInput): reset shouldHandleKeyboardEvents on unmount (#1495)(by @koplyarov) ([`81cd66f`](https://github.com/gorhom/react-native-bottom-sheet/commit/81cd66f9c49843e43231d1d81ec4aa518a9f1b95))
- updated containerOffset top value to default to 0 (#1420)(by @beqramo) ([`b81cb93`](https://github.com/gorhom/react-native-bottom-sheet/commit/b81cb9368b55c24703a9c000a76e89a2d253e141))

#### Chores And Housekeeping

- updated expo and react native deps (#1445) ([`f6f2304`](https://github.com/gorhom/react-native-bottom-sheet/commit/f6f2304235c05f92d86ce8083caf910b9297a10a))

### [v5.0.0-alpha.3](https://github.com/gorhom/react-native-bottom-sheet/compare/v5.0.0-alpha.2...v5.0.0-alpha.3) - 25 June 2023

#### Fixes

- resume close animation when container gets resized (#1374) (#1392) ([`1f69625`](https://github.com/gorhom/react-native-bottom-sheet/commit/1f69625e180fcec4d8d3dec436f8d5bb4eba476b))
- (bottom-sheet-modal): added container component prop to modal (#1309)(by @magrinj) ([`67e1e09`](https://github.com/gorhom/react-native-bottom-sheet/commit/67e1e09acbc0e96e435a0c2247fa1e0bc19f91aa))
- updated scrollables mocks with ReactNative list equivalent (#1394)(by @gkueny) ([`630f87f`](https://github.com/gorhom/react-native-bottom-sheet/commit/630f87ff6bd19c4dfc071783139c938eda3baf6c))

#### Chores And Housekeeping

- updated react native and other deps (#1412) ([`549e461`](https://github.com/gorhom/react-native-bottom-sheet/commit/549e461530a91e1d7c95a5178bd2238ebf84df86))

### [v5.0.0-alpha.2](https://github.com/gorhom/react-native-bottom-sheet/compare/v5.0.0-alpha.1...v5.0.0-alpha.2) - 4 June 2023

#### Fixes

- crash on swipe down (#1367)(by @beqramo) ([`3ccbefc`](https://github.com/gorhom/react-native-bottom-sheet/commit/3ccbefc4d16558867d518f7e0306fbb4d1dbdbeb))

### [v5.0.0-alpha.1](https://github.com/gorhom/react-native-bottom-sheet/compare/v5.0.0-alpha.0...v5.0.0-alpha.1) - 30 April 2023

#### Fixes

- (BottomSheetScrollView): updated scroll responders props type (#1335)(by @eps1lon) ([`e42fafc`](https://github.com/gorhom/react-native-bottom-sheet/commit/e42fafcc492d01665c296bf551a6a264eb866fc5))
- fixed keyboard dismissing issue with Reanimated v3 (#1346)(by @janicduplessis) ([`1d1a464`](https://github.com/gorhom/react-native-bottom-sheet/commit/1d1a46489bede1d3f119df2fb6f467e778461c39))

#### Chores And Housekeeping

- fixed types (#1123)(by @stropho) ([`b440964`](https://github.com/gorhom/react-native-bottom-sheet/commit/b44096451d4fed81be7f08b0edf638e4a1c42ccd))

### [v5.0.0-alpha.0](https://github.com/gorhom/react-native-bottom-sheet/compare/v4.4.8...v5.0.0-alpha.0) - 18 March 2023

#### New Features

- added web support (#1150) ([`a996b4a`](https://github.com/gorhom/react-native-bottom-sheet/commit/a996b4aa68139136ec75e0921025d235471c838d))
- rewrite gesture apis with gesture handler 2 (#1126) ([`6a4d296`](https://github.com/gorhom/react-native-bottom-sheet/commit/6a4d2967684b01e28f23b1b35afbb4cc4dabaf1d))

#### Fixes

- (#1119): fixed race condition between onmount and keyboard animations ([`a1ec74d`](https://github.com/gorhom/react-native-bottom-sheet/commit/a1ec74dbbc85476bb39f3637e9a97214e0cad9a0))

#### Chores And Housekeeping

- updated reanimated to v3 (#1324) ([`4829316`](https://github.com/gorhom/react-native-bottom-sheet/commit/4829316beeff95c9e2efa5fbfdfcf7ef37b4af60))

### [v4.4.8](https://github.com/gorhom/react-native-bottom-sheet/compare/v4.4.7...v4.4.8) - 6 September 2023

#### Fixes

- (bottom-sheet-modal): added container component prop to modal (#1309)(by @magrinj) ([`1ecad69`](https://github.com/gorhom/react-native-bottom-sheet/commit/1ecad692d9477f7c7f8d7f54fcf7f990aabe5a04))
- (BottomSheetTextInput): reset shouldHandleKeyboardEvents on unmount (#1495)(by @koplyarov) ([`6a5034c`](https://github.com/gorhom/react-native-bottom-sheet/commit/6a5034cd83c24db65a12444ba8d9e949fd64f316))
- updated scrollables mocks with ReactNative list equivalent (#1394)(by @gkueny) ([`ea03e78`](https://github.com/gorhom/react-native-bottom-sheet/commit/ea03e78f40d2c5c028467ebf6f1959fb5381b93d))
- updated containerOffset top value to default to 0 (#1420)(by @beqramo) ([`218e006`](https://github.com/gorhom/react-native-bottom-sheet/commit/218e006a4a015625fcf424b99f432319daf88aad))

### [v4.4.7](https://github.com/gorhom/react-native-bottom-sheet/compare/v4.4.6...v4.4.7) - 4 June 2023

#### Fixes

- resume close animation when container gets resized (#1374) (#1392) ([`92ad842`](https://github.com/gorhom/react-native-bottom-sheet/commit/92ad84283afb389ee23768f0c29e7808af4b6b0c))
- crash on swipe down (#1367)(by @beqramo) ([`235466f`](https://github.com/gorhom/react-native-bottom-sheet/commit/235466fef552f2cf7cbbafb06029cdd879624606))

### [v4.4.6](https://github.com/gorhom/react-native-bottom-sheet/compare/v4.4.5...v4.4.6) - 30 April 2023

#### Fixes

- fixed keyboard dismissing issue with Reanimated v3 (#1346)(by @janicduplessis) ([`94cf11e`](https://github.com/gorhom/react-native-bottom-sheet/commit/94cf11eb43f9cc2a356da7e7967ec63baf390a74))
- (BottomSheetScrollView): updated scroll responders props type (#1335)(by @eps1lon) ([`9c5af58`](https://github.com/gorhom/react-native-bottom-sheet/commit/9c5af584516690cb5143caabb7722e0c2340cc57))
- correctly check for non-null object (#1122)(by @stropho) ([`54abf0c`](https://github.com/gorhom/react-native-bottom-sheet/commit/54abf0c0832d1451dfe11be212fc5f938ff5c5fd))

#### Chores And Housekeeping

- fixed types (#1123)(by @stropho) ([`d41eda2`](https://github.com/gorhom/react-native-bottom-sheet/commit/d41eda227e76b89432164ec8dc5cc1ebd5f638ee))

### [v4.4.5](https://github.com/gorhom/react-native-bottom-sheet/compare/v4.4.4...v4.4.5) - 19 September 2022

#### Refactoring and Updates

Expand Down Expand Up @@ -230,7 +365,7 @@
- add kickbk as a contributor for bug, test (#612) ([`3316c8b`](https://github.com/gorhom/react-native-bottom-sheet/commit/3316c8b92662e5be92d2c355f3fa04632eb8b6bf))
- add vonovak as a contributor for code (#611) ([`7c97e8f`](https://github.com/gorhom/react-native-bottom-sheet/commit/7c97e8ffd76936a5168ad9f914bdc5e1ab1b3bdd))

### [v4.0.0](https://github.com/gorhom/react-native-bottom-sheet/compare/v4.0.0-alpha.30...v4.0.0) - 30 August 2021
## [v4.0.0](https://github.com/gorhom/react-native-bottom-sheet/compare/v4.0.0-alpha.30...v4.0.0) - 30 August 2021

#### Documentation Changes

Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ A performant interactive bottom sheet with fully configurable options 🚀

## Features

- Modal presentation view, [Bottom Sheet Modal](https://gorhom.github.io/react-native-bottom-sheet/modal).
- Modal presentation view, [Bottom Sheet Modal](https://ui.gorhom.dev/components/bottom-sheet/modal).
- Smooth gesture interactions & snapping animations.
- Seamless [keyboard handling](https://gorhom.github.io/react-native-bottom-sheet/keyboard-handling) for iOS & Android.
- Support [pull to refresh](https://gorhom.github.io/react-native-bottom-sheet/pull-to-refresh) for scrollables.
- Support [FlatList](https://gorhom.github.io/react-native-bottom-sheet/components/bottomsheetflatlist), [SectionList](https://gorhom.github.io/react-native-bottom-sheet/components/bottomsheetsectionlist), [ScrollView](https://gorhom.github.io/react-native-bottom-sheet/components/bottomsheetscrollview) & [View](https://gorhom.github.io/react-native-bottom-sheet/components/bottomsheetview) scrolling interactions.
- Support [React Navigation integration](https://gorhom.github.io/react-native-bottom-sheet/react-navigation-integration).
- Compatible with `Reanimated` v1 & v2.
- Seamless [keyboard handling](https://ui.gorhom.dev/components/bottom-sheet/keyboard-handling) for iOS & Android.
- Support [pull to refresh](https://ui.gorhom.dev/components/bottom-sheet/pull-to-refresh) for scrollables.
- Support [FlatList](https://ui.gorhom.dev/components/bottom-sheet/components/bottomsheetflatlist), [SectionList](https://ui.gorhom.dev/components/bottom-sheet/components/bottomsheetsectionlist), [ScrollView](https://ui.gorhom.dev/components/bottom-sheet/components/bottomsheetscrollview) & [View](https://ui.gorhom.dev/components/bottom-sheet/components/bottomsheetview) scrolling interactions.
- Support [React Navigation integration](https://ui.gorhom.dev/components/bottom-sheet/react-navigation-integration).
- Compatible with `Reanimated` v1-3.
- Compatible with `Expo`.
- Accessibility support.
- Written in `TypeScript`.
- [Read more](https://gorhom.github.io/react-native-bottom-sheet).
- [Read more](https://ui.gorhom.dev/components/bottom-sheet).

## Getting Started

Expand All @@ -35,9 +35,11 @@ This library been written in 2 versions of `Reanimated`, and kept both implement

- **`v2`** | [branch](https://github.com/gorhom/react-native-bottom-sheet/tree/v2) | [changelog](https://github.com/gorhom/react-native-bottom-sheet/blob/v2/CHANGELOG.md) : written with `Reanimated v1` & compatible with `Reanimated v2`.

- **`v4`** | [branch](https://github.com/gorhom/react-native-bottom-sheet/tree/master) | [changelog](https://github.com/gorhom/react-native-bottom-sheet/blob/master/CHANGELOG.md) : written with `Reanimated v2`.
- **`v4`** | [branch](https://github.com/gorhom/react-native-bottom-sheet/tree/v4) | [changelog](https://github.com/gorhom/react-native-bottom-sheet/blob/v4/CHANGELOG.md) : written with `Reanimated v2`.

> I highly recommend all `v3` users to upgrade to `v4` which provides more stability and all latest features.
- **`v5`** | [branch](https://github.com/gorhom/react-native-bottom-sheet/tree/master) | [changelog](https://github.com/gorhom/react-native-bottom-sheet/blob/master/CHANGELOG.md) : written with `Reanimated v3` & `Gesture Handler v2`.

> I highly recommend to use `v5` which provides more stability with all latest features.

## Author

Expand Down Expand Up @@ -82,3 +84,4 @@ To keep this library maintained and up-to-date please consider [sponsoring it on
<img height="18" alt="Mo Gorhom" src="./mogorhom-dark.png">
</a>
</p>
s
5 changes: 5 additions & 0 deletions eslint-plugin-bottom-sheet/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
rules: {
'no-reanimated-hook-deps': require('./rules/no-reanimated-hook-deps'),
},
};
6 changes: 6 additions & 0 deletions eslint-plugin-bottom-sheet/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "eslint-plugin-bottom-sheet",
"version": "1.0.0",
"private": true,
"main": "index.js"
}
60 changes: 60 additions & 0 deletions eslint-plugin-bottom-sheet/rules/no-reanimated-hook-deps.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
'use strict';

const noReanimatedHookDeps =
'Do not include dependency arrays in Reanimated hooks. This can lead to unexpected behavior or bugs. \
See reanimated docs https://reanimated-beta-docs.swmansion.com/docs/core/useAnimatedStyle#dependencies-.';

const REANIMATED_HOOKS = new Set([
'useAnimatedStyle',
'useAnimatedProps',
'useDerivedValue',
'useAnimatedReaction',
]);

module.exports = {
meta: {
messages: {
noReanimatedHookDeps,
},
docs: {
description: 'Ensure Reanimated hooks do not include dependency arrays.',
category: 'Code Safety',
},
fixable: 'code',
schema: [
{
type: 'object',
properties: {},
additionalProperties: false,
},
],
},

create(context) {
return {
CallExpression(node, _parent) {
if (!REANIMATED_HOOKS.has(node.callee.name)) {
return;
}

const depsArgIndex = node.arguments.length - 1;
const previousArg = node.arguments[depsArgIndex - 1];
const depsArg = node.arguments[depsArgIndex];

if (depsArg != null && depsArg.type === 'ArrayExpression') {
context.report({
node: depsArg,
messageId: 'noReanimatedHookDeps',

fix(fixer) {
return fixer.removeRange([
previousArg.range[1],
depsArg.range[1],
]);
},
});
}
},
};
},
};
35 changes: 35 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo
25 changes: 25 additions & 0 deletions example/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import { StyleSheet } from 'react-native';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import Main from './src/Main';

import { enableScreens } from 'react-native-screens';
enableScreens(true);

// @ts-ignore
import { enableLogging } from '@gorhom/bottom-sheet';
enableLogging();

export default function App() {
return (
<GestureHandlerRootView style={styles.container}>
<Main />
</GestureHandlerRootView>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
},
});
Loading