Skip to content

Commit

Permalink
use React.ReactNode as type for children elements
Browse files Browse the repository at this point in the history
  • Loading branch information
KKA11010 committed Dec 19, 2023
1 parent 0601ef9 commit 89a270f
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function _App() {
)
}

function NavContainer({ children }: { children: JSX.Element | JSX.Element[] }) {
function NavContainer({ children }: { children: React.ReactNode }) {
const navigation = useRef<NavigationContainerRef<ReactNavigation.RootParamList>>(null)
const { theme } = useThemeContext()

Expand Down
2 changes: 1 addition & 1 deletion src/components/Screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/context/FocusClaim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const FocusClaimCtx = createContext<useFocusClaimType>({

export const useFocusClaimContext = () => useContext(FocusClaimCtx)

export const FocusClaimProvider = ({ children }: { children: JSX.Element }) => (
export const FocusClaimProvider = ({ children }: { children: React.ReactNode }) => (
<FocusClaimCtx.Provider value={useFocusClaim()} >
{children}
</FocusClaimCtx.Provider>
Expand Down
2 changes: 1 addition & 1 deletion src/context/Keyboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const KeyboardCtx = createContext<useKeyboardType>({

export const useKeyboardCtx = () => useContext(KeyboardCtx)

export const KeyboardProvider = ({ children }: { children: JSX.Element | JSX.Element[] }) => (
export const KeyboardProvider = ({ children }: { children: React.ReactNode }) => (
<KeyboardCtx.Provider value={useKeyboard()}>
{children}
</KeyboardCtx.Provider>
Expand Down
2 changes: 1 addition & 1 deletion src/context/Nostr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const NostrContext = createContext<useNostrType>({

export const useNostrContext = () => useContext(NostrContext)

export const NostrProvider = ({ children }: { children: JSX.Element }) => (
export const NostrProvider = ({ children }: { children: React.ReactNode }) => (
<NostrContext.Provider value={useNostr()} >
{children}
</NostrContext.Provider>
Expand Down
2 changes: 1 addition & 1 deletion src/context/Privacy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const PrivacyContext = createContext<usePrivacyType>({

export const usePrivacyContext = () => useContext(PrivacyContext)

export const PrivacyProvider = ({ children }: { children: JSX.Element }) => (
export const PrivacyProvider = ({ children }: { children: React.ReactNode }) => (
<PrivacyContext.Provider value={usePrivacy()} >
{children}
</PrivacyContext.Provider>
Expand Down
2 changes: 1 addition & 1 deletion src/context/Prompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const PromptCtx = createContext<usePromptType>({

export const usePromptContext = () => useContext(PromptCtx)

export const PromptProvider = ({ children }: { children: JSX.Element }) => (
export const PromptProvider = ({ children }: { children: React.ReactNode }) => (
<PromptCtx.Provider value={usePrompt()} >
{children}
</PromptCtx.Provider>
Expand Down
2 changes: 1 addition & 1 deletion src/context/Release.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const ReleaseCtx = createContext<useReleaseType>({

export const useReleaseContext = () => useContext(ReleaseCtx)

export const ReleaseProvider = ({ children }: { children: JSX.Element | JSX.Element[] }) => (
export const ReleaseProvider = ({ children }: { children: React.ReactNode }) => (
<ReleaseCtx.Provider value={useRelease()} >
{children}
</ReleaseCtx.Provider>
Expand Down
2 changes: 1 addition & 1 deletion src/context/Theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const ThemeContext = createContext<useThemeType>({

export const useThemeContext = () => useContext(ThemeContext)

export const ThemeProvider = ({ children }: { children: JSX.Element }) => (
export const ThemeProvider = ({ children }: { children: React.ReactNode }) => (
<ThemeContext.Provider value={useTheme()} >
{children}
</ThemeContext.Provider>
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Addressbook/Contact/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export default function ContactPage({ navigation, route }: IContactPageProps) {
}

interface ISmallBtnProps {
children: JSX.Element
children: React.ReactNode
onPress: () => void
}

Expand Down

0 comments on commit 89a270f

Please sign in to comment.