# i18next-react-component-postprocessor

> i18next react component postprocessor

Latest version **1.0.5** (published 2018-08-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install i18next-react-component-postprocessor
pnpm add i18next-react-component-postprocessor
yarn add i18next-react-component-postprocessor
bun add i18next-react-component-postprocessor
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2018-08-29 |
| First published | 2018-07-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Maxim Leontiev |
| Maintainers | maxim-leont |
| Keywords | i18next, postprocessor, react |

## Links

- npm: https://www.npmjs.com/package/i18next-react-component-postprocessor
- Repository: https://github.com/maximLeontiev/i18next-react-component-postprocessor
- Issues: https://github.com/maximLeontiev/i18next-react-component-postprocessor/issues
- npm.io page: https://npm.io/package/i18next-react-component-postprocessor

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2018-08-29
- 1.0.4 — 2018-08-21
- 1.0.3 — 2018-08-21
- 1.0.2 — 2018-08-02
- 1.0.1 — 2018-07-18
- 1.0.0 — 2018-07-18

## README

# i18next-react-component-postprocessor

### Introduction
If you want to insert some interactive component into the i18next string, for example link,
you must concatenate strings and component. And when it is a React component it may be impossible.
This package helps to insert React components in the i18next string.

### Getting started

```bash
npm i --save i18next-react-component-postprocessor
```
```javascript
import i18next      from 'i18next';
import I18nReact    from 'i18next-react-component-postprocessor';

const config = {
	postProcess: ['i18nReact']
}

i18next.use(new I18nReact()).init(config);

```


### Usage
```json
{
	"key": "Go to <Link title='our company' text='our web site' /> now"
}
```

```html
<p>
	{
		i18next.t('key', {
			Link: ({ title, text }) => <a href="#" title={title}>{text}</a>
		})
	}
</p>

```

### Default props

#### Bold
| props | type | value |
| ------|:-----:|:-----:|
| text  | String | *empty* |


#### Italic
| props | type | value |
| ------|:-----:|:-----:|
| text  | String | *empty* |



#### Link
| props | type | value |
| ------|:-----:|:-----:|
| text  | String | *empty* |
| alt  | String | *empty* |
| href  | String | # |

### Customize
```javascript
import i18next      from 'i18next';
import I18nReact    from 'i18next-react-component-postprocessor';

const config = {
	postProcess: ['i18nReact']
}

i18next.use(new I18nReact({
	Link: ({href, text, alt}) => <div>{href} {text}</div>
})).init(config);

```

---
_Source: https://npm.io/package/i18next-react-component-postprocessor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
