Skip to content

Commit

Permalink
Fix child props
Browse files Browse the repository at this point in the history
  • Loading branch information
blazejkustra committed Jun 20, 2024
1 parent 1b6e0a9 commit 267719f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/OfflineWithFeedback.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {mapValues} from 'lodash';
import React, {useCallback} from 'react';
import type {ImageStyle, StyleProp, TextStyle, ViewStyle} from 'react-native';
import type {StyleProp, ViewStyle} from 'react-native';
import {View} from 'react-native';
import useNetwork from '@hooks/useNetwork';
import useStyleUtils from '@hooks/useStyleUtils';
Expand Down Expand Up @@ -59,7 +59,7 @@ type OfflineWithFeedbackProps = ChildrenProps & {
canDismissError?: boolean;
};

type StrikethroughProps = Partial<ChildrenProps> & {style: Array<ViewStyle | TextStyle | ImageStyle>};
type StrikethroughProps = Partial<ChildrenProps> & {style: AllStyles[]};

function OfflineWithFeedback({
pendingAction,
Expand Down Expand Up @@ -106,9 +106,9 @@ function OfflineWithFeedback({
return child;
}

const childProps = child.props as {children: React.ReactNode | undefined; style: AllStyles};
const childProps = child.props as {children?: React.ReactNode; style?: AllStyles};
const props: StrikethroughProps = {
style: StyleUtils.combineStyles(childProps.style, styles.offlineFeedback.deleted, styles.userSelectNone),
style: StyleUtils.combineStyles(childProps.style ?? [], styles.offlineFeedback.deleted, styles.userSelectNone),
};

if (childProps.children) {
Expand Down

0 comments on commit 267719f

Please sign in to comment.