render-primitive
v1.0.0
Published
Renders JS primitives as text in React
Downloads
2
Readme
render-primitive
Renders JS primitives as text in React
Install
npm install --save render-primitive
Usage
import React, { Component } from 'react'
import RenderPrimitive from 'render-primitive'
class Example extends Component {
render () {
return (
<div>
{/* Basic usage */}
<RenderPrimitive>{true}</RenderPrimitive>
<RenderPrimitive>{false}</RenderPrimitive>
<RenderPrimitive>{undefined}</RenderPrimitive>
<RenderPrimitive>{null}</RenderPrimitive>
<RenderPrimitive>{123}</RenderPrimitive>
<RenderPrimitive>{new Symbol('foo')}</RenderPrimitive>
<RenderPrimitive>{'bar'}</RenderPrimitive>
{/* Prop shortcut */}
<RenderPrimitive value={false} />
</div>
)
}
}
License
MIT © jutaz