Package Exports
- @ricardojrmcom/echo
- @ricardojrmcom/echo/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ricardojrmcom/echo) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
☁ @ricardojrmcom/echo
React lightweight intl
Install
npm install @ricardojrmcom/echo
yarn add @ricardojrmcom/echoUsage
// component
import { Echo, EchoProps } from '@ricardojrmcom/echo';
// hook
import { useEcho, EchoRecord, EchoMsgs } from '@ricardojrmcom/echo';
// provider
import { EchoProvider, EchoProviderProps } from '@ricardojrmcom/echo';
// app
const exampleEcho: EchoRecord = {
en: {
example: 'example en',
},
pt: {
example: 'exemplo pt',
},
};
<EchoProvider echo={exampleEcho} echoDefault="en">
{...}
</EchoProvider>
// component
const Echo = ({ echoid }: EchoProps) => {
const { echo } = useEcho();
return <span>{echo(echoid)}</span>;
};
<Echo echoid="example" />License
MIT © Ricardo <l1b3r_-> Mota (@ricardojrmcom)
Bootstrapped with 🟣@ricardojrmcom/supernova