Reduce mental overhead by wrapping conditional logic in a react component
npm install react-conditionally-renderReadability is important, and conditional renders often introduce a complexity that make it difficult to follow what is going on. This component aims to solve that by creating a readable interface in the form of a react component
Simple usage:
``
import Profile from './Profile'
import AnonymousProfile from './AnonymousProfile'
show={
elseShow={
/>
`
Usage with functions:
`
import Profile from './Profile'
import AnonymousProfile from './AnonymousProfile'
const renderProfile = () => {
return
}
const renderAnonymousProfile = () => {
return
}
show={renderProfile}
elseShow={renderAnonymousProfile}
/>
``