Skip to content

Commit

Permalink
fix type reanimated
Browse files Browse the repository at this point in the history
  • Loading branch information
ngocle2497 committed Aug 15, 2023
1 parent cce1bc9 commit f80c20f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rn-boiler-template",
"private": false,
"version": "1.72.2",
"version": "1.72.3",
"description": "Clean and minimalist React Native template for a quick start with TypeScript and components",
"scripts": {
"test": "exit 0"
Expand Down
2 changes: 1 addition & 1 deletion template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"react-native-keyboard-manager": "6.5.11-0",
"react-native-linear-gradient": "^2.7.3",
"react-native-mmkv": "^2.10.1",
"react-native-reanimated": "^3.3.0",
"react-native-reanimated": "^3.4.2",
"react-native-safe-area-context": "^4.7.1",
"react-native-screens": "^3.22.1",
"react-native-svg": "^13.10.0",
Expand Down
14 changes: 8 additions & 6 deletions template/src/app/library/components/modal/modal-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ export const ModalContent = forwardRef(
return (
<Animated.View pointerEvents="box-none" style={[styles.content, style]}>
<Animated.View
entering={entering?.withCallback(onEndAnimatedOpen)}
exiting={exiting?.withCallback(onEndAnimatedClose)}>
entering={(entering as any)?.withCallback(onEndAnimatedOpen)}
exiting={(entering as any)?.withCallback(onEndAnimatedClose)}>
{children}
</Animated.View>
</Animated.View>
Expand Down Expand Up @@ -189,10 +189,12 @@ export const ModalContent = forwardRef(
}, []);

// props
const modalViewProps = useAnimatedProps<ViewProps>(() => ({
pointerEvents:
reBackdropOpacity.value === backdropOpacity ? 'auto' : 'none',
}));
const modalViewProps = useAnimatedProps<CustomOmit<ViewProps, 'style'>>(
() => ({
pointerEvents:
reBackdropOpacity.value === backdropOpacity ? 'auto' : 'none',
}),
);

// render
return (
Expand Down
7 changes: 2 additions & 5 deletions template/src/app/library/components/stack-view/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ import Animated from 'react-native-reanimated';
import { StackViewProps } from './type';

export const StackView = forwardRef(
(
{ children, ...rest }: StackViewProps,
ref: React.ForwardedRef<Animated.ScrollView>,
) => {
({ children, ...rest }: StackViewProps, ref: any) => {
// render
return (
<Animated.ScrollView
ref={ref}
ref={ref as any}
showsVerticalScrollIndicator={false}
showsHorizontalScrollIndicator={false}
scrollEventThrottle={16}
Expand Down
5 changes: 3 additions & 2 deletions template/src/app/library/components/stack-view/type.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { ScrollViewProps } from 'react-native';

export interface StackViewProps extends ScrollViewProps {
import Animated, { AnimatedProps } from 'react-native-reanimated';

export interface StackViewProps extends AnimatedProps<Animated.ScrollView> {
children?: React.ReactNode;
}

0 comments on commit f80c20f

Please sign in to comment.