react-hit-miss
jsx conditional rendering inspired by react-router v4
Last updated a year 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 (a year ago)

5 Versions

  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.0                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
  • 0.0.1                                ...           4 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 - 2017 © taobao.org |