JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15
  • Score
    100M100P100Q32509F
  • License MIT

Minimalistic react components

Package Exports

  • react-mini

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-mini) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-mini Build Status

Create minimalistic react components

For inline components or if you are really lazy.

Install

$ npm install --save react-mini

Usage

var React = require('react');
var mini = require('react-mini');


module.exports = mini( (me, props) => <h1>Title: {props.title}</h1> );
module.exports = mini( (me, props) => !props.hidden?<h1>Title: {props.title}</h1>:null );

with props and state

var Counter = mini( (me, props = { step: 1 } , state) => { 
    var incCounter = () => me.setState({ count : me.state.count + props.step });

  return <span>Counter: {state.count}<button onClick={incCounter}>+1</button></span> 
}, { count: 10 });

React.render(
  <Counter step={10}/>,
  document.body
)

License

MIT © Christoph Hermann