1.1.1 • Published 5 years ago

react-hit-miss v1.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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>);
1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

7 years ago

0.1.0

7 years ago

0.0.1

7 years ago