react-intl

  • Version 12.1.0
  • Published
  • 199 kB
  • 3 dependencies
  • BSD-3-Clause license

Install

npm i react-intl
yarn add react-intl
pnpm add react-intl

Overview

Internationalize React apps. This library provides React components and an API to format dates, numbers, and strings, including pluralization and handling translations.

Index

Variables

variable { typed: true

const {
typed: true: any

    variable createIntl

    const createIntl: CreateIntlFn<React.ReactNode, IntlConfig, IntlShape>;
    • Create intl object

      Parameter config

      intl config

      Parameter cache

      cache for formatter instances to prevent memory leak

    variable D

    const D: any;

      variable D

      const D: any;

        variable D

        const D: any;

          variable D

          const D: any;

            variable DEFAULT_INTL_CONFIG$1

            const DEFAULT_INTL_CONFIG$1: DefaultIntlConfig;

              variable FormattedDate

              const FormattedDate: React.FC<any>;

                variable FormattedDateParts

                const FormattedDateParts: React.FC<any>;

                  variable FormattedDateTimeRange

                  const FormattedDateTimeRange: React.FC<Props$3>;

                    variable FormattedDisplayName

                    const FormattedDisplayName: React.FC<Intl.DisplayNamesOptions & { value: string }>;

                      variable FormattedDuration

                      const FormattedDuration: React.FC<any>;

                        variable FormattedDurationParts

                        const FormattedDurationParts: React.FC<any>;

                          variable FormattedList

                          const FormattedList: React.FC<
                          Intl.ListFormatOptions & { value: Parameters<IntlShape['formatList']>[0] }
                          >;

                            variable FormattedListParts

                            const FormattedListParts: React.FC<any>;

                              variable FormattedMessage

                              const FormattedMessage: FormattedMessageComponent;

                                variable FormattedNumber

                                const FormattedNumber: React.FC<any>;

                                  variable FormattedNumberParts

                                  const FormattedNumberParts: React.FC<any>;

                                    variable FormattedPlural

                                    const FormattedPlural: React.FC<Props$1>;

                                      variable FormattedRelativeTime

                                      const FormattedRelativeTime: React.FC<Props>;

                                        variable FormattedTime

                                        const FormattedTime: React.FC<any>;

                                          variable FormattedTimeParts

                                          const FormattedTimeParts: React.FC<any>;

                                            variable IntlContext

                                            const IntlContext: React.Context<IntlShape>;

                                              variable IntlProvider

                                              const IntlProvider: React.FC<React.PropsWithChildren<IntlConfig>>;

                                                variable K

                                                const K: any;

                                                  variable K

                                                  const K: any;

                                                    variable MessageDescriptor$1

                                                    const MessageDescriptor$1: boolean;

                                                      variable options

                                                      const options: any;

                                                        variable RawIntlProvider

                                                        const RawIntlProvider: React.Provider<IntlShape>;

                                                          variable RegisteredMessageId

                                                          const RegisteredMessageId: any;

                                                            variable RegisteredMessageId

                                                            const RegisteredMessageId: any;

                                                              variable UntypedMessageDescriptor

                                                              const UntypedMessageDescriptor: any;

                                                                variable UntypedMessageDescriptor

                                                                const UntypedMessageDescriptor: boolean;

                                                                  Functions

                                                                  function defineMessage

                                                                  defineMessage: {
                                                                  <V extends MessageValues = {}>(): any;
                                                                  <V extends MessageValues = {}>(message: any, options?: { typed: true }): any;
                                                                  <V extends MessageValues = {}>(message: any, options?: { typed: true }): any;
                                                                  <V extends MessageValues = {}>(message: any, options?: { typed: true }): any;
                                                                  <V extends MessageValues = {}>(message: any, options?: { typed: true }): any;
                                                                  <V extends MessageValues = {}>(message: any, options?: { typed: true }): any;
                                                                  <V extends MessageValues = {}>(
                                                                  message: MessageDescriptor$1,
                                                                  options?: { typed: true }
                                                                  ): TypedMessageDescriptor$1<NoInfer<V>>;
                                                                  <T extends MessageDescriptor$1>(message: T): Readonly<T>;
                                                                  };

                                                                    function useIntl

                                                                    useIntl: (this: void) => IntlShape;

                                                                      Interfaces

                                                                      interface IntlShape

                                                                      interface IntlShape extends ResolvedIntlConfig, IntlFormatters$1<React.ReactNode> {}

                                                                        method formatMessage

                                                                        formatMessage: {
                                                                        <
                                                                        V extends MessageValues = never,
                                                                        T extends React.ReactNode = React.ReactNode
                                                                        >(
                                                                        this: void,
                                                                        descriptor: [V] extends [never] ? never : UntypedMessageDescriptor,
                                                                        ...args: TypedMessageArguments<NoInfer<V>, string, T>
                                                                        ): MessageTextOutput$1;
                                                                        <
                                                                        V extends MessageValues = never,
                                                                        T extends React.ReactNode = React.ReactNode
                                                                        >(
                                                                        this: void,
                                                                        descriptor: [V] extends [never] ? never : UntypedMessageDescriptor,
                                                                        ...args: TypedMessageArguments<NoInfer<V>, T>
                                                                        ): string | T | (string | T)[];
                                                                        <D extends TypedMessageDescriptor$1<MessageValues>>(
                                                                        this: void,
                                                                        descriptor: D,
                                                                        ...args: TypedMessageArguments<
                                                                        MessageValuesOf$1<NoInfer<D>>,
                                                                        string,
                                                                        React.ReactNode
                                                                        >
                                                                        ): MessageTextOutput$1;
                                                                        <D extends TypedMessageDescriptor$1<MessageValues>>(
                                                                        this: void,
                                                                        descriptor: D,
                                                                        ...args: TypedMessageArguments<
                                                                        MessageValuesOf$1<NoInfer<D>>,
                                                                        React.ReactNode
                                                                        >
                                                                        ): React.ReactNode;
                                                                        (): any;
                                                                        };

                                                                          interface ResolvedIntlConfig

                                                                          interface ResolvedIntlConfig extends ResolvedIntlConfig$1<React.ReactNode> {}

                                                                            property textComponent

                                                                            textComponent?: React.ComponentType | keyof React.JSX.IntrinsicElements;

                                                                              property wrapRichTextChunksInFragment

                                                                              wrapRichTextChunksInFragment?: boolean;

                                                                                Type Aliases

                                                                                type IntlConfig

                                                                                type IntlConfig = Omit<ResolvedIntlConfig, keyof typeof DEFAULT_INTL_CONFIG$1> &
                                                                                Partial<typeof DEFAULT_INTL_CONFIG$1>;

                                                                                  Package Files (1)

                                                                                  Dependencies (3)

                                                                                  Dev Dependencies (0)

                                                                                  No dev dependencies.

                                                                                  Peer Dependencies (2)

                                                                                  Badge

                                                                                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/react-intl.

                                                                                  • Markdown
                                                                                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/react-intl)
                                                                                  • HTML
                                                                                    <a href="https://www.jsdocs.io/package/react-intl"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>