InterviewHubPRO
Section Overview
Q90

Question 90 of 445

Part 3: React Internationalization (89 - 94)

20%
React & Modern Frontend (445 Qs)•Part 3: React Internationalization (89 - 94)

What are the main features of React Intl?

Below are the main features of React Intl,

  1. Display numbers with separators.
  2. Display dates and times correctly.
  3. Display dates relative to "now".
  4. Pluralize labels in strings.
  5. Support for 150+ languages.
  6. Runs in the browser and Node.
  7. Built on standards.

Practical Code Example

jsx
// React Intl features: Pluralization, Currency, Relative Time formatting:
import { FormattedNumber, FormattedDate } from 'react-intl';

function Transaction({ amount, date }) {
  return (
    <div>
      <FormattedNumber value={amount} style="currency" currency="USD" />
      <FormattedDate value={date} year="numeric" month="long" day="numeric" />
    </div>
  );
}