Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
ceceppa committed Dec 1, 2023
1 parent 5543bc3 commit 988e1aa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/forms/src/hooks/useFormField.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useAMAContext, useChecks } from '@react-native-ama/core';
import { applyStyle } from '@react-native-ama/internal';
import React from 'react';
import { Keyboard } from 'react-native';
import { Keyboard, ViewStyle } from 'react-native';

import { useForm } from '../components/Form';

Expand All @@ -12,7 +12,7 @@ export type UseFormField = {
nextFieldId?: string;
nextFormFieldRef?: React.RefObject<any>;
accessibilityHint?: string;
style?: Record<string, any>;
style?: ViewStyle;
editable?: boolean;
hasValidation: boolean;
hasError?: boolean;
Expand Down
3 changes: 2 additions & 1 deletion packages/internal/src/utils/applyStyle.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ReactNode } from 'react';
import { ViewStyle } from 'react-native';

import type { ContrastChecker } from '../checks/contrastChecker';

Expand Down Expand Up @@ -37,7 +38,7 @@ export const applyStyle = __DEV__
children,
contrastCheckerCallback,
}: {
style: Record<string, any> | Function;
style: ViewStyle | Function | any;
debugStyle: Record<any, any>;
children?: ReactNode;
contrastCheckerCallback?:
Expand Down
8 changes: 5 additions & 3 deletions packages/lists/src/components/DynamicFlatList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const DynamicFlatList = React.forwardRef<
forwardedRef,
) => {
const dynamicList = useDynamicList({
data: data!,
data: data ?? [],
pluralMessage,
singularMessage,
numColumns: rest.numColumns,
Expand All @@ -29,7 +29,8 @@ export const DynamicFlatList = React.forwardRef<
return __DEV__ ? (
<ListWrapper
rowsCount={dynamicList.rowsCount}
columnsCount={dynamicList.columnsCount}>
columnsCount={dynamicList.columnsCount}
>
<FlatList
data={data}
{...rest}
Expand All @@ -40,7 +41,8 @@ export const DynamicFlatList = React.forwardRef<
) : (
<ListWrapper
rowsCount={dynamicList.rowsCount}
columnsCount={dynamicList.columnsCount}>
columnsCount={dynamicList.columnsCount}
>
<FlatList data={data} {...rest} ref={forwardedRef} />
</ListWrapper>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/lists/src/hooks/useDynamicList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import { AccessibilityInfo } from 'react-native';

export type UseDynamicList = {
data: readonly any[];
data: ArrayLike<any>;
singularMessage: string;
pluralMessage: string;
isPlural?: (count: number) => boolean;
Expand Down

0 comments on commit 988e1aa

Please sign in to comment.