fix: change provider children type to ReactNode (#270)

This commit is contained in:
defectivepixel 2023-03-19 16:39:14 +03:30 committed by GitHub
parent c8662542d6
commit c3a359f554
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -6,7 +6,7 @@ export const IconoirContext = React.createContext<IconoirContextValue>({})
export interface IconoirProviderProps {
iconProps?: Partial<Omit<SvgProps, 'children'>>
children: React.ReactElement
children: React.ReactNode
}
export function IconoirProvider({ iconProps, children }: IconoirProviderProps) {
return <IconoirContext.Provider value={iconProps || {}} children={children} />

View file

@ -5,7 +5,7 @@ export const IconoirContext = React.createContext<IconoirContextValue>({})
export interface IconoirProviderProps {
iconProps?: Partial<React.SVGProps<SVGSVGElement>>
children: React.ReactElement
children: React.ReactNode
}
export function IconoirProvider({ iconProps, children }: IconoirProviderProps) {
return <IconoirContext.Provider value={iconProps || {}} children={children} />

View file

@ -7,7 +7,7 @@ console.warn('Using IconoirContext in server components has no effect, because '
export interface IconoirContextValue {}
export const IconoirContext = null
interface IconoirProviderProps {
children: React.ReactElement
children: React.ReactNode
}
export function IconoirProvider({ children }: IconoirProviderProps) {
return children