@ricardojrmcom/echo
v3.0.0
Published
React lightweight intl
Downloads
3
Maintainers
Readme
☁ @ricardojrmcom/echo
React lightweight intl
Install
npm install @ricardojrmcom/echo
yarn add @ricardojrmcom/echo
Usage
// 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