react-hit-miss
jsx conditional rendering inspired by react-router v4
Last updated 6 months ago by gorangajic .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install react-hit-miss 
SYNC missed versions from official npm registry.

React Hit Miss Component

Build Status

jsx conditional rendering inspired by react-router v4

npm install react-hit-miss --save

example

import HitMiss, { Hit, Miss } from 'react-hit-miss';

const Awesome = ({ error, items, loading }) => (<HitMiss>
    <Hit
        check={error}
        component={() => (<div>
            {error}
        </div>)}
    />
    <Hit
        check={items && items.length > 0}
        component={() => (<div>
            {items.map(item => <Item {...item} />)}
        </div>)}
    />
    <Hit
        check={loading}
        component={LoadingSpinner}
    />
    <Miss
        component={() => (<div>
            No items found
        </div>)}
    />
</HitMiss>);

Current Tags

  • 1.1.1                                ...           latest (6 months ago)

5 Versions

  • 1.1.1                                ...           6 months ago
  • 1.1.0                                ...           6 months ago
  • 1.0.0                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
  • 0.0.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (20)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |