Skip to content

Commit

Permalink
Remove @types/react 1.7x override and fix type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hbriese committed Jul 14, 2023
1 parent 86a77a6 commit 7960856
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/src/components/sheet/Sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const Sheet = forwardRef<BottomSheet, SheetProps>(
onLayout={handleContentLayout}
style={[styles.contentContainer, contentContainerStyle]}
>
{children}
<>{children}</>
</BottomSheetView>
</BottomSheet>
);
Expand Down
11 changes: 9 additions & 2 deletions app/src/components/skeleton/withSuspense.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@ import { FC, ReactNode, Suspense } from 'react';
import { isFunctionalComponent } from '~/util/typing';

export const withSuspense =
<Props extends {}>(Component: FC<Props>, Fallback: FC<Props> | NonNullable<ReactNode>) =>
<Props extends {}, FallbackProps extends Partial<Props & any>>(
Component: FC<Props>,
Fallback: FC<FallbackProps> | ReactNode,
) =>
(props: Props) =>
(
<Suspense fallback={isFunctionalComponent(Fallback) ? <Fallback {...props} /> : Fallback}>
<Suspense
fallback={
isFunctionalComponent(Fallback) ? <Fallback {...props} /> : (Fallback as ReactNode)
}
>
<Component {...props} />
</Suspense>
);
2 changes: 1 addition & 1 deletion app/src/components/tab/TabBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const TabBadge = memo(({ style, ...props }: TabBadgeProps) => {
const width = flattened?.width || isLarge(props) ? 12 + 4 * value.length : 6;

const transform = [
translateX ? { translateX: translateX.translateX - width } : undefined,
translateX ? { translateX: translateX.translateX } : undefined,
{ translateY: 8 },
].filter(isPresent);

Expand Down
3 changes: 2 additions & 1 deletion app/src/screens/proposal/TransactionTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ import { TabNavigatorScreenProp } from './Tabs';
import { TabBadge } from '~/components/tab/TabBadge';
import { makeStyles } from '@theme/makeStyles';
import { Hex } from 'lib';
import { ReactNode } from 'react';

const Item = (props: ListItemProps) => (
const Item = (props: Omit<ListItemProps, 'trailing'> & { trailing: ReactNode }) => (
<ListItem
{...props}
trailing={
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
"graphql": "^16.6.0",
"dotenv": "^16.3.1",
"[email protected]": "patch:react-native-jazzicon@npm:0.1.2#.yarn/patches/react-native-jazzicon-npm-0.1.2-c1633b051f.patch",
"@ethersproject/abstract-provider": "5.7.0",
"@types/react": "17.x"
"@ethersproject/abstract-provider": "5.7.0"
},
"dependencies": {
"eslint-plugin-neverthrow": "^1.1.4",
Expand Down

0 comments on commit 7960856

Please sign in to comment.