Skip to content

Commit

Permalink
fix: lint and typescript errors
Browse files Browse the repository at this point in the history
  • Loading branch information
andreialecu committed Oct 3, 2021
1 parent 243848d commit dc5fd39
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ export const Container = React.memo(
</Animated.View>
{headerHeight !== undefined && (
<AnimatedFlatList
// @ts-expect-error problem with reanimated types, they're missing `ref`
ref={containerRef}
initialScrollIndex={index.value}
data={data}
Expand Down
8 changes: 7 additions & 1 deletion src/FlatList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ import {
const FlatListMemo = React.memo(
React.forwardRef<RNFlatList, React.PropsWithChildren<FlatListProps<unknown>>>(
(props, passRef) => {
return <AnimatedFlatList ref={passRef} {...props} />
return (
<AnimatedFlatList
// @ts-expect-error problem with reanimated types, they're missing `ref`
ref={passRef}
{...props}
/>
)
}
)
)
Expand Down
3 changes: 1 addition & 2 deletions src/MaterialTabBar/Indicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import Animated, {
} from 'react-native-reanimated'

import { isRTL } from '../helpers'

import { IndicatorProps } from './types'

const Indicator: React.FC<IndicatorProps> = ({
Expand All @@ -28,7 +27,7 @@ const Indicator: React.FC<IndicatorProps> = ({
indexDecimal.value,
itemsLayout.map((_, i) => i),
// when in RTL mode, the X value should be inverted
itemsLayout.map((v) => isRTL ? -1 * v.x : v.x)
itemsLayout.map((v) => (isRTL ? -1 * v.x : v.x))
),
},
]
Expand Down
8 changes: 7 additions & 1 deletion src/SectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ const SectionListMemo = React.memo(
RNSectionList,
React.PropsWithChildren<SectionListProps<unknown>>
>((props, passRef) => {
return <AnimatedSectionList ref={passRef} {...props} />
return (
<AnimatedSectionList
// @ts-expect-error problem with reanimated types, they're missing `ref`
ref={passRef}
{...props}
/>
)
})
)

Expand Down

0 comments on commit dc5fd39

Please sign in to comment.