Skip to content

Commit

Permalink
Bump types in example
Browse files Browse the repository at this point in the history
  • Loading branch information
m-bert committed Feb 19, 2025
1 parent 82245c5 commit 5ad18eb
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@tsconfig/react-native": "^3.0.5",
"@types/jest": "^29.5.12",
"@types/metro-config": "^0.76.3",
"@types/react": "~18.3.12",
"@types/react": "^19.0.0",
"@types/react-test-renderer": "^18.3.0",
"@typescript-eslint/parser": "^7.8.0",
"babel-jest": "^29.7.0",
Expand Down
2 changes: 1 addition & 1 deletion example/src/new_api/calculator/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ interface OutputProps {

function Output({ offset, expression, history }: OutputProps) {
const layout = useRef({});
const scrollView = useRef<ScrollView>();
const scrollView = useRef<ScrollView>(null);
const drag = useSharedValue(0);
const dragOffset = useSharedValue(0);
const [opened, setOpened] = useState(false);
Expand Down
8 changes: 4 additions & 4 deletions example/src/new_api/swipeable/AppleStyleSwipeableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface AppleStyleSwipeableRowProps {

interface LeftActionsProps {
dragX: SharedValue<number>;
swipeableRef: React.RefObject<SwipeableMethods>;
swipeableRef: React.RefObject<SwipeableMethods | null>;
}

const LeftAction = ({ dragX, swipeableRef }: LeftActionsProps) => {
Expand Down Expand Up @@ -48,7 +48,7 @@ const LeftAction = ({ dragX, swipeableRef }: LeftActionsProps) => {
const renderLeftActions = (
_: any,
progress: SharedValue<number>,
swipeableRef: React.RefObject<SwipeableMethods>
swipeableRef: React.RefObject<SwipeableMethods | null>
) => <LeftAction dragX={progress} swipeableRef={swipeableRef} />;

interface RightActionProps {
Expand All @@ -57,7 +57,7 @@ interface RightActionProps {
x: number;
progress: SharedValue<number>;
totalWidth: number;
swipeableRef: React.RefObject<SwipeableMethods>;
swipeableRef: React.RefObject<SwipeableMethods | null>;
}

const RightAction = ({
Expand Down Expand Up @@ -95,7 +95,7 @@ const RightAction = ({
const renderRightActions = (
_: any,
progress: SharedValue<number>,
swipeableRef: React.RefObject<SwipeableMethods>
swipeableRef: React.RefObject<SwipeableMethods | null>
) => (
<View style={styles.rightActionsView}>
<RightAction
Expand Down
8 changes: 4 additions & 4 deletions example/src/new_api/swipeable/GmailStyleSwipeableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Swipeable, {

interface LeftActionProps {
dragX: SharedValue<number>;
swipeableRef: React.RefObject<SwipeableMethods>;
swipeableRef: React.RefObject<SwipeableMethods | null>;
}
const LeftAction = ({ dragX, swipeableRef }: LeftActionProps) => {
const animatedStyle = useAnimatedStyle(() => ({
Expand All @@ -38,12 +38,12 @@ const LeftAction = ({ dragX, swipeableRef }: LeftActionProps) => {
const renderLeftActions = (
_: any,
progress: SharedValue<number>,
swipeableRef: React.RefObject<SwipeableMethods>
swipeableRef: React.RefObject<SwipeableMethods | null>
) => <LeftAction dragX={progress} swipeableRef={swipeableRef} />;

interface RightActionProps {
dragX: SharedValue<number>;
swipeableRef: React.RefObject<SwipeableMethods>;
swipeableRef: React.RefObject<SwipeableMethods | null>;
}
const RightAction = ({ dragX, swipeableRef }: RightActionProps) => {
const animatedStyle = useAnimatedStyle(() => ({
Expand All @@ -67,7 +67,7 @@ const RightAction = ({ dragX, swipeableRef }: RightActionProps) => {
const renderRightActions = (
_: any,
progress: SharedValue<number>,
swipeableRef: React.RefObject<SwipeableMethods>
swipeableRef: React.RefObject<SwipeableMethods | null>
) => <RightAction dragX={progress} swipeableRef={swipeableRef} />;
interface GmailStyleSwipeableRowProps {
children?: ReactNode;
Expand Down
4 changes: 2 additions & 2 deletions example/src/recipes/panAndScroll/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const windowWidth = Dimensions.get('window').width;
const circleRadius = 30;

type Props = {
tapRef: React.RefObject<TapGestureHandler>;
panRef: React.RefObject<PanGestureHandler>;
tapRef: React.RefObject<TapGestureHandler | null>;
panRef: React.RefObject<PanGestureHandler | null>;
};

export class TapOrPan extends Component<Props> {
Expand Down
9 changes: 8 additions & 1 deletion example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2883,14 +2883,21 @@
dependencies:
"@types/react" "^18"

"@types/react@^18", "@types/react@~18.3.12":
"@types/react@^18":
version "18.3.18"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.18.tgz#9b382c4cd32e13e463f97df07c2ee3bbcd26904b"
integrity sha512-t4yC+vtgnkYjNSKlFx1jkAhH8LgTo2N/7Qvi83kdEaUtMDiwpbLAktKDaAMlRcJ5eSxZkH74eEGt1ky31d7kfQ==
dependencies:
"@types/prop-types" "*"
csstype "^3.0.2"

"@types/react@^19.0.0":
version "19.0.10"
resolved "https://registry.yarnpkg.com/@types/react/-/react-19.0.10.tgz#d0c66dafd862474190fe95ce11a68de69ed2b0eb"
integrity sha512-JuRQ9KXLEjaUNjTWpzuR231Z2WpIwczOkBEIvbHNCzQefFIT0L8IqE6NV6ULLyC1SI/i234JnDoMkfg+RjQj2g==
dependencies:
csstype "^3.0.2"

"@types/semver@^7.3.12":
version "7.5.8"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e"
Expand Down

0 comments on commit 5ad18eb

Please sign in to comment.