Skip to content

Commit

Permalink
fix: specify children for react v18 types (#1230)
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherklint97 committed Apr 24, 2022
1 parent 0e270a3 commit ee69736
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/macro/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export type TransProps = {
comment?: string
values?: Record<string, unknown>
context?: string
children?: React.ReactNode
component?: React.ComponentType<TransRenderProps>
render?: (props: TransRenderProps) => ReactElement<any, any> | null
}
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/I18nProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export type withI18nProps = {

export type I18nProviderProps = I18nContext & {
forceRenderOnLocaleChange?: boolean
children?: React.ReactNode
}

const LinguiContext = React.createContext<I18nContext>(null)
Expand Down
3 changes: 2 additions & 1 deletion packages/react/src/Trans.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { formatElements } from "./format"
export type TransRenderProps = {
id?: string
translation?: React.ReactNode
children?: string | any[] | React.ReactNode
children?: React.ReactNode
message?: string | null
}

Expand All @@ -17,6 +17,7 @@ export type TransProps = {
context?: string
components: { [key: string]: React.ElementType | any }
formats?: Object
children?: React.ReactNode
component?: React.ComponentType<TransRenderProps>
render?: (props: TransRenderProps) => React.ReactElement<any, any> | null
}
Expand Down

0 comments on commit ee69736

Please sign in to comment.