React Tag component, like the normal HTML <tag> but useful
npm install react-tag   
React Tag component, universal tag render, like the normal HTML but useful.
- ✅ stateless
- ✅ 0 dependency
- ✅ without invade, works well with normal tags
When you want to show or hide a div, you probably do this everytime:
``js`
render() {
const style = {
display: show ? '' : 'none'
}
return (
)
}
And we always dynamically add or remove classes inconvenient.
or using the JedWatson/classnames
` Today you can stop doing that. output: output: Dynamically toggle css classes render() { output: Dynamically hide the div. Sometime we don't want to render DOM, you can hide it by passing a output nothing:js
const classNames = require('classnames')
render() {
const css = {
foo: true,
bar: false
}
return (
a b c ${classNames(css)}} />`
)
}React Tag is your new friend.React TagExamples
In each normal HTML tag will becomes uppercase of first letter, you can import for need:`js`
import {Div, Img, P, H1, Button} form 'react-tag'
render() {
return (
)
}`html`
React Tag
Let yourself Component extends 's power`js`
import {Div} from 'react-tag'
class YourComponent extends Component {
render() {
return (
)
}
}`props
$3
Dynamically show the divjs`
import {Div} from 'react-tag'
render() {
return This is Dev Component
}`html``$3
js`
import {Div} from 'react-tag'
const css = {
foo: true,
bar: false
}
return
}`html`hide$3
props:`js`
import {Div} from 'react-tag'
render() {
return
}`html``