diff --git a/app/containers/ActionSheet/ActionSheet.tsx b/app/containers/ActionSheet/ActionSheet.tsx index c465076c22..8551d5dbf2 100644 --- a/app/containers/ActionSheet/ActionSheet.tsx +++ b/app/containers/ActionSheet/ActionSheet.tsx @@ -182,7 +182,7 @@ const ActionSheet = React.memo(forwardRef(({ children, theme }: {children: JSX.E styles.container, { backgroundColor: themes[theme].focusedBackground }, (isLandscape || isTablet) && styles.bottomSheet - ]} + ] as any} animationConfig={ANIMATION_CONFIG} // FlatList props data={data?.options} diff --git a/app/containers/ActionSheet/Provider.tsx b/app/containers/ActionSheet/Provider.tsx index de2a64ebf5..c8715b6133 100644 --- a/app/containers/ActionSheet/Provider.tsx +++ b/app/containers/ActionSheet/Provider.tsx @@ -1,10 +1,14 @@ -import React, { useRef, useContext, forwardRef } from 'react'; -import PropTypes from 'prop-types'; +import React, {useRef, useContext, forwardRef, ForwardedRef} from 'react'; import ActionSheet from './ActionSheet'; import { useTheme } from '../../theme'; -const context = React.createContext({ +interface IActionSheetProvider { + Provider: any; + Consumer: any; +} + +const context: IActionSheetProvider = React.createContext({ showActionSheet: () => {}, hideActionSheet: () => {} }); @@ -13,15 +17,15 @@ export const useActionSheet = () => useContext(context); const { Provider, Consumer } = context; -export const withActionSheet = (Component: any) => forwardRef((props, ref) => ( +export const withActionSheet = (Component: React.FC) => forwardRef((props: any, ref: ForwardedRef) => ( - {contexts => } + {(contexts: any) => } )); -export const ActionSheetProvider = React.memo(({ children }) => { - const ref: any = useRef(); - const { theme } = useTheme(); +export const ActionSheetProvider = React.memo(({ children }: {children: JSX.Element}) => { + const ref: ForwardedRef = useRef(); + const { theme }: any = useTheme(); const getContext = () => ({ showActionSheet: (options: any) => { @@ -40,6 +44,3 @@ export const ActionSheetProvider = React.memo(({ children }) => { ); }); -ActionSheetProvider.propTypes = { - children: PropTypes.node -}; diff --git a/app/containers/ActivityIndicator.tsx b/app/containers/ActivityIndicator.tsx index 3f21cac6a9..50a60f0c32 100644 --- a/app/containers/ActivityIndicator.tsx +++ b/app/containers/ActivityIndicator.tsx @@ -32,10 +32,4 @@ const RCActivityIndicator = ({ theme = 'light', absolute, ...props }: IActivityI /> ); - -// TODO - test the app without the theme default -// RCActivityIndicator.defaultProps = { -// theme: 'light' -// }; - export default RCActivityIndicator;