https://github.com/gjc9620/react-string-template
🚀 simple string template with react! 🚀
https://github.com/gjc9620/react-string-template
es6 javascript react string-template
Last synced: 6 months ago
JSON representation
🚀 simple string template with react! 🚀
- Host: GitHub
- URL: https://github.com/gjc9620/react-string-template
- Owner: gjc9620
- Created: 2018-12-10T16:09:31.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-23T16:04:15.000Z (about 7 years ago)
- Last Synced: 2025-01-13T22:48:02.555Z (about 1 year ago)
- Topics: es6, javascript, react, string-template
- Language: JavaScript
- Homepage:
- Size: 136 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-string-template
react-string-template is simple string template with react
## install
`npm i --save react-string-template`
``` jsx
'not match'}
values={{
name: Harry Potter, // Don't forget write key
foo: 'fantasy',
bar: 'novels',
author: 'J. K. Rowling',
yeah: 1997,
}} >
{(children)=>
{children}}
//Harry Potter is a series of fantasy novels written by British {author} J. K. Rowling in 1997.
```
``` jsx
// add click event
alert('Patronus!')}>
Patronus
),
}} >
{(children)=>
{children}}
```
``` jsx
// render no Match
'not match'} >
{(children)=>
{children}}
//I am not match
```
If you don't need escape use `{{escape}}`