react-mini
Create minimalistic react components
Allows you to create thisless react components. With react >= 0.14
stateless function components are supported by react itself. But with react-mini
you can create statefull function components.
Install
$ npm install --save react-mini
Usage
var React = ;var mini = ; moduleexports = ;moduleexports = ;moduleexports = ;moduleexports = ;
Pure components
Create pure components using PureRenderMixin
var React = ;var pure = ; moduleexports = ;
with props and state thisless
var Counter = ; // <= initialState React
API
mini(render:Function(props, component), [initialState:Object])
render
: This is the actual render function.props:Object
: The props of the componentcomponent:Object
: The component (this
)
initialState
: The initial state of the component.
Related
- react-mini-this -
function HelloWorld({name}) { return <h1> Hello {name} </h1>; }::pure();
License
MIT © Christoph Hermann