From 89a270ff48b9e19c5a5e16f90649ce9928420064 Mon Sep 17 00:00:00 2001 From: KKA11010 Date: Tue, 19 Dec 2023 15:17:16 +0100 Subject: [PATCH] use React.ReactNode as type for children elements --- src/components/App.tsx | 2 +- src/components/Screen.tsx | 2 +- src/context/FocusClaim.tsx | 2 +- src/context/Keyboard.tsx | 2 +- src/context/Nostr.tsx | 2 +- src/context/Privacy.tsx | 2 +- src/context/Prompt.tsx | 2 +- src/context/Release.tsx | 2 +- src/context/Theme.tsx | 2 +- src/screens/Addressbook/Contact/index.tsx | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index 178f6e77..6db2dc43 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -230,7 +230,7 @@ function _App() { ) } -function NavContainer({ children }: { children: JSX.Element | JSX.Element[] }) { +function NavContainer({ children }: { children: React.ReactNode }) { const navigation = useRef>(null) const { theme } = useThemeContext() diff --git a/src/components/Screen.tsx b/src/components/Screen.tsx index cd905840..3450a45d 100644 --- a/src/components/Screen.tsx +++ b/src/components/Screen.tsx @@ -4,7 +4,7 @@ import { globals } from '@styles' import { View } from 'react-native' interface IContainerProps { - children: JSX.Element | JSX.Element[] + children: React.ReactNode screenName?: string withBackBtn?: boolean withCancelBtn?: boolean diff --git a/src/context/FocusClaim.tsx b/src/context/FocusClaim.tsx index 9553f3f8..d8a0eeec 100644 --- a/src/context/FocusClaim.tsx +++ b/src/context/FocusClaim.tsx @@ -108,7 +108,7 @@ const FocusClaimCtx = createContext({ export const useFocusClaimContext = () => useContext(FocusClaimCtx) -export const FocusClaimProvider = ({ children }: { children: JSX.Element }) => ( +export const FocusClaimProvider = ({ children }: { children: React.ReactNode }) => ( {children} diff --git a/src/context/Keyboard.tsx b/src/context/Keyboard.tsx index 825ce220..dbddde81 100644 --- a/src/context/Keyboard.tsx +++ b/src/context/Keyboard.tsx @@ -29,7 +29,7 @@ const KeyboardCtx = createContext({ export const useKeyboardCtx = () => useContext(KeyboardCtx) -export const KeyboardProvider = ({ children }: { children: JSX.Element | JSX.Element[] }) => ( +export const KeyboardProvider = ({ children }: { children: React.ReactNode }) => ( {children} diff --git a/src/context/Nostr.tsx b/src/context/Nostr.tsx index c507d800..ea667c47 100644 --- a/src/context/Nostr.tsx +++ b/src/context/Nostr.tsx @@ -128,7 +128,7 @@ const NostrContext = createContext({ export const useNostrContext = () => useContext(NostrContext) -export const NostrProvider = ({ children }: { children: JSX.Element }) => ( +export const NostrProvider = ({ children }: { children: React.ReactNode }) => ( {children} diff --git a/src/context/Privacy.tsx b/src/context/Privacy.tsx index 2f13c14d..06a802ea 100644 --- a/src/context/Privacy.tsx +++ b/src/context/Privacy.tsx @@ -81,7 +81,7 @@ const PrivacyContext = createContext({ export const usePrivacyContext = () => useContext(PrivacyContext) -export const PrivacyProvider = ({ children }: { children: JSX.Element }) => ( +export const PrivacyProvider = ({ children }: { children: React.ReactNode }) => ( {children} diff --git a/src/context/Prompt.tsx b/src/context/Prompt.tsx index b68c939b..94ea06c8 100644 --- a/src/context/Prompt.tsx +++ b/src/context/Prompt.tsx @@ -56,7 +56,7 @@ const PromptCtx = createContext({ export const usePromptContext = () => useContext(PromptCtx) -export const PromptProvider = ({ children }: { children: JSX.Element }) => ( +export const PromptProvider = ({ children }: { children: React.ReactNode }) => ( {children} diff --git a/src/context/Release.tsx b/src/context/Release.tsx index bcc15850..223cc2cb 100644 --- a/src/context/Release.tsx +++ b/src/context/Release.tsx @@ -41,7 +41,7 @@ const ReleaseCtx = createContext({ export const useReleaseContext = () => useContext(ReleaseCtx) -export const ReleaseProvider = ({ children }: { children: JSX.Element | JSX.Element[] }) => ( +export const ReleaseProvider = ({ children }: { children: React.ReactNode }) => ( {children} diff --git a/src/context/Theme.tsx b/src/context/Theme.tsx index ef726342..8da89303 100644 --- a/src/context/Theme.tsx +++ b/src/context/Theme.tsx @@ -85,7 +85,7 @@ const ThemeContext = createContext({ export const useThemeContext = () => useContext(ThemeContext) -export const ThemeProvider = ({ children }: { children: JSX.Element }) => ( +export const ThemeProvider = ({ children }: { children: React.ReactNode }) => ( {children} diff --git a/src/screens/Addressbook/Contact/index.tsx b/src/screens/Addressbook/Contact/index.tsx index 0b426652..c1291042 100644 --- a/src/screens/Addressbook/Contact/index.tsx +++ b/src/screens/Addressbook/Contact/index.tsx @@ -225,7 +225,7 @@ export default function ContactPage({ navigation, route }: IContactPageProps) { } interface ISmallBtnProps { - children: JSX.Element + children: React.ReactNode onPress: () => void }