diff --git a/.eslintrc.js b/.eslintrc.js index cdc024184..60ab22df3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -3,16 +3,6 @@ module.exports = { extends: ['@react-native-community', 'prettier'], rules: { 'no-console': ['error', { allow: ['warn', 'error'] }], - 'prettier/prettier': [ - 'error', - { - printWidth: 80, - arrowParens: 'avoid', - singleQuote: true, - tabWidth: 2, - trailingComma: 'es5', - useTabs: false, - }, - ], + 'prettier/prettier': 'error', }, }; diff --git a/example/src/components/contactListContainer/ContactListContainer.tsx b/example/src/components/contactListContainer/ContactListContainer.tsx index f260ae786..6c5b0334a 100644 --- a/example/src/components/contactListContainer/ContactListContainer.tsx +++ b/example/src/components/contactListContainer/ContactListContainer.tsx @@ -14,9 +14,10 @@ const ContactListContainerComponent = ({ headerStyle: _headerStyle, onItemPress, }: ContactListContainerProps) => { - const headerStyle = useMemo(() => [styles.headerContainer, _headerStyle], [ - _headerStyle, - ]); + const headerStyle = useMemo( + () => [styles.headerContainer, _headerStyle], + [_headerStyle] + ); return ( <> diff --git a/example/src/screens/advanced/BackdropExample.tsx b/example/src/screens/advanced/BackdropExample.tsx index 1b9cef270..0eb829481 100644 --- a/example/src/screens/advanced/BackdropExample.tsx +++ b/example/src/screens/advanced/BackdropExample.tsx @@ -6,9 +6,8 @@ import ContactListContainer from '../../components/contactListContainer'; const BackdropExample = () => { // state - const [backdropPressBehavior, setBackdropPressBehavior] = useState< - 'none' | 'close' | 'collapse' - >('collapse'); + const [backdropPressBehavior, setBackdropPressBehavior] = + useState<'none' | 'close' | 'collapse'>('collapse'); // hooks const bottomSheetRef = useRef(null); diff --git a/example/src/screens/modal/BackdropExample.tsx b/example/src/screens/modal/BackdropExample.tsx index d8309ca09..8b770b3fb 100644 --- a/example/src/screens/modal/BackdropExample.tsx +++ b/example/src/screens/modal/BackdropExample.tsx @@ -11,9 +11,8 @@ import withModalProvider from '../withModalProvider'; const BackdropExample = () => { // state - const [backdropPressBehavior, setBackdropPressBehavior] = useState< - 'none' | 'close' | 'collapse' - >('collapse'); + const [backdropPressBehavior, setBackdropPressBehavior] = + useState<'none' | 'close' | 'collapse'>('collapse'); // refs const bottomSheetRef = useRef(null); diff --git a/src/components/bottomSheetHandleContainer/BottomSheetHandleContainer.tsx b/src/components/bottomSheetHandleContainer/BottomSheetHandleContainer.tsx index afc3a0990..b417323b1 100644 --- a/src/components/bottomSheetHandleContainer/BottomSheetHandleContainer.tsx +++ b/src/components/bottomSheetHandleContainer/BottomSheetHandleContainer.tsx @@ -44,11 +44,6 @@ function BottomSheetHandleContainerComponent({ return refs; }, [_providedSimultaneousHandlers, _internalSimultaneousHandlers]); - - const shouldRenderHandle = useMemo( - () => _providedHandleComponent !== null, - [_providedHandleComponent] - ); //#endregion //#region callbacks @@ -96,6 +91,7 @@ function BottomSheetHandleContainerComponent({ ); }, [animatedIndex, animatedPosition, _providedHandleComponent]); + const shouldRenderHandle = _providedHandleComponent !== null; return shouldRenderHandle ? ( ( ref={scrollableRef} overScrollMode={overScrollMode} scrollEventThrottle={16} - onScrollBeginDrag={handleScrollEvent} + onScroll={handleScrollEvent} animatedProps={scrollableAnimatedProps} style={containerStyle} /> diff --git a/src/hooks/useScrollableInternal.ts b/src/hooks/useScrollableInternal.ts index 195f7eafb..def0f4889 100644 --- a/src/hooks/useScrollableInternal.ts +++ b/src/hooks/useScrollableInternal.ts @@ -109,7 +109,6 @@ export const useScrollableInternal = () => { : 0; // @ts-ignore scrollTo(scrollableRef, 0, lockPosition, false); - scrollableContentOffsetY.value = lockPosition; scrollableContentOffsetY.value = 0; return; }