Formats string using string, number, and react components as paramaters
npm install react-string-format
import { format } from 'react-string-format';
format('first: {0}; second: {1}', 'hello', 'word');
// result:
'first: hello; second: word'
format('first: {0}; second: {1}', 1, 2);
// result:
'first: 1; second: 2'
format('hiperlink: {0}, span tag: {1}', <a href="#">Click Me</a>, <span>Bla-bla</span>);
// result:
<React.Fragment>
<React.Fragment key={0}>hiperlink: </React.Fragment>
<React.Fragment key={1}>
<a href="#">Click Me</a>
</React.Fragment>
<React.Fragment key={2}>, span tag: </React.Fragment>
<React.Fragment key={3}>
<span>Bla-bla</span>
</React.Fragment>
</React.Fragment>