React Interpolate Plugin
Smart interpolation for react components.
Peer Dependencies
- React >=16.2
API
interpolate(key: string, params: Array<any>): string | Array<any>
- Interpolate values with specified parameters
How to use
npm i react react-interpolate-plugin
; ; const key = 'Some {0} for {1} {2}.'; const element = <span>smart</span>; const Component = <span>interpolation</span>; const Example = { return } // Result: // Some text for smart interpolation.
Test
npm test
License
MIT