react-empty-placeholder

0.0.3 • Public • Published

react-empty-placeholder

Placeholder component to wrap the content(other components) that you don't know if it will show anything

NPM npm JavaScript Style Guide

Install

yarn add react-empty-placeholder
# or 
npm install --save react-empty-placeholder

Usage

import React, { Component } from 'react'
 
import EmptyPlaceholder from 'react-empty-placeholder'
 
class Example extends Component {
  render () {
    return (
      <EmptyPlaceholder placeholder={<div>placeholder if nothing display inside</div>}>
        {this.props.boolean && <div>show when boolean is truthy</div>}
 
        <SomeComponentYouDontKnowIfItWillShowAnything />
      </EmptyPlaceholder>
    )
  }
}

License

MIT © Donald

Package Sidebar

Install

npm i react-empty-placeholder

Weekly Downloads

6

Version

0.0.3

License

MIT

Unpacked Size

11.6 kB

Total Files

5

Last publish

Collaborators

  • donaldcwl