@lingui/react
Advanced tools
Comparing version 4.3.0 to 4.4.0
import React, { ComponentType, FunctionComponent } from 'react'; | ||
import { I18n } from '@lingui/core'; | ||
import { MessageOptions, I18n } from '@lingui/core'; | ||
@@ -13,3 +13,3 @@ type TransRenderProps = { | ||
component?: undefined; | ||
render?: (props: TransRenderProps) => React.ReactElement<any, any> | null; | ||
render?: ((props: TransRenderProps) => React.ReactElement<any, any>) | null; | ||
} | { | ||
@@ -26,3 +26,3 @@ component?: React.ComponentType<TransRenderProps> | null; | ||
}; | ||
formats?: Record<string, unknown>; | ||
formats?: MessageOptions["formats"]; | ||
comment?: string; | ||
@@ -32,14 +32,27 @@ children?: React.ReactNode; | ||
declare function Trans(props: TransProps): React.ReactElement<any, any> | null; | ||
/** | ||
* Version of `<Trans>` component without using a Provider/Context React feature. | ||
* Primarily made for support React Server Components (RSC) | ||
* | ||
* @experimental the api of this component is not stabilized yet. | ||
*/ | ||
declare function TransNoContext(props: TransProps & { | ||
lingui: { | ||
i18n: I18n; | ||
defaultComponent?: ComponentType<TransRenderProps>; | ||
}; | ||
}): React.ReactElement<any, any> | null; | ||
type I18nContext = { | ||
i18n: I18n; | ||
_: I18n["_"]; | ||
defaultComponent?: ComponentType<TransRenderProps>; | ||
}; | ||
type I18nProviderProps = I18nContext & { | ||
type I18nProviderProps = Omit<I18nContext, "_"> & { | ||
children?: React.ReactNode; | ||
}; | ||
declare const LinguiContext: React.Context<I18nContext>; | ||
declare const LinguiContext: React.Context<I18nContext | null>; | ||
declare function useLingui(): I18nContext; | ||
declare const I18nProvider: FunctionComponent<I18nProviderProps>; | ||
export { I18nContext, I18nProvider, I18nProviderProps, LinguiContext, Trans, TransProps, TransRenderCallbackOrComponent, TransRenderProps, useLingui }; | ||
export { I18nContext, I18nProvider, I18nProviderProps, LinguiContext, Trans, TransNoContext, TransProps, TransRenderCallbackOrComponent, TransRenderProps, useLingui }; |
{ | ||
"name": "@lingui/react", | ||
"version": "4.3.0", | ||
"version": "4.4.0", | ||
"sideEffects": false, | ||
@@ -66,3 +66,3 @@ "description": "React components for translations", | ||
"@babel/runtime": "^7.20.13", | ||
"@lingui/core": "4.3.0" | ||
"@lingui/core": "4.4.0" | ||
}, | ||
@@ -79,3 +79,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "da6c52629e978c24ec83f2a6c22e4dfc910808b4" | ||
"gitHead": "c36c0340ced1c4b76d5e1c340785932122449ac9" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23245
593
+ Added@lingui/core@4.4.0(transitive)
+ Added@lingui/message-utils@4.4.0(transitive)
- Removed@lingui/core@4.3.0(transitive)
- Removed@lingui/message-utils@4.3.0(transitive)
Updated@lingui/core@4.4.0