Skip to content

Commit

Permalink
Merge branch 'main' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-bodnar committed Mar 14, 2023
1 parent ba41f35 commit 8d34239
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions packages/react/src/Trans.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export type TransRenderProps = {
export type TransProps = {
id: string
message?: string
values: Record<string, unknown>
components: { [key: string]: React.ElementType | any }
values?: Record<string, unknown>
components?: { [key: string]: React.ElementType | any }
formats?: Record<string, unknown>
children?: React.ReactNode
component?: React.ComponentType<TransRenderProps>
Expand All @@ -26,8 +26,8 @@ export function Trans(props: TransProps): React.ReactElement<any, any> | null {
const { i18n, defaultComponent } = useLingui()
const { render, component, id, message, formats } = props

const values = { ...props.values }
const components = { ...props.components }
const values = { ...(props.values || {}) }
const components = { ...(props.components || {}) }

if (values) {
/*
Expand Down Expand Up @@ -113,8 +113,3 @@ export function Trans(props: TransProps): React.ReactElement<any, any> | null {
<Component>{translation}</Component>
)
}

Trans.defaultProps = {
values: {},
components: {},
}

0 comments on commit 8d34239

Please sign in to comment.