Placeholder component to wrap the content(other components) that you don't know if it will show anything
yarn add react-empty-placeholder
# or
npm install --save react-empty-placeholder
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>
)
}
}
MIT © Donald