Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: specify children for react v18 types #1230

Merged
merged 2 commits into from
Apr 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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