babel-plugin-react-intl-2-lingui

1.0.7 • Public • Published

Install

npm i -D babel-plugin-react-intl-2-lingui

Then put to your .babelrc as plugin as following example:

{
  "presets": [
    "@babel/preset-env",
    "@babel/preset-react"
  ],
  "plugins": [
    "babel-plugin-react-intl-2-lingui"
  ]
}

Objective

Just to convert existing react-intl components likes of FormattedMessage to Trans of @lingui package

Simple use case:

In

import { FormattedMessage } from "react-intl";

<FormattedMessage id="Hello world!" defaultMessage="Hello world!" />

Out

import { Trans } from "@lingui/react";

<Trans id="Hello world!" defaults="Hello world!" />

Package Sidebar

Install

npm i babel-plugin-react-intl-2-lingui

Weekly Downloads

12

Version

1.0.7

License

MIT

Unpacked Size

23.4 kB

Total Files

17

Last publish

Collaborators

  • tmhao2005