Interface ReactOptions

Hierarchy

  • ReactOptions

Properties

bindI18n?: string | false

Set which events trigger a re-render, can be set to false or string of events

Default

'languageChanged'
bindI18nStore?: string | false

Set which events on store trigger a re-render, can be set to false or string of events

Default

''
defaultTransParent?: string

Set it to the default parent element created by the Trans component.

Default

'div'
keyPrefix?: string

Optional keyPrefix that will be automatically applied to returned t function in useTranslation for example.

Default

undefined
nsMode?: "default" | "fallback"

Set it to fallback to let passed namespaces to translated hoc act as fallbacks

Default

'default'
transEmptyNodeValue?: string

Set fallback value for Trans components without children

Default

undefined
transKeepBasicHtmlNodesFor?: readonly string[]

Which nodes not to convert in defaultValue generation in the Trans component.

Default

['br', 'strong', 'i', 'p']
transSupportBasicHtmlNodes?: boolean

Convert eg.
found in translations to a react component of type br

Default

true
transWrapTextNodes?: string

Wrap text nodes in a user-specified element.

Default

''
useSuspense?: boolean

Set it to false if you do not want to use Suspense

Default

true

Methods

  • Function to generate an i18nKey from the defaultValue (or Trans children) when no key is provided. By default, the defaultValue (Trans text) itself is used as the key. If you want to require keys for all translations, supply a function that always throws an error.

    Parameters

    • defaultValue: any

    Returns any

    Default

    undefined
    
  • Unescape function by default it unescapes some basic html entities

    Parameters

    • str: string

    Returns string

Generated using TypeDoc