Add show if component

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
Tilman Vatteroth 2020-06-04 22:52:23 +02:00 committed by mrdrogdrog
parent 70c6f2cf74
commit 03e1bf361a

View file

@ -0,0 +1,9 @@
import React, { Fragment } from 'react'
export interface ShowIfProps {
condition: boolean
}
export const ShowIf: React.FC<ShowIfProps> = ({ children, condition }) => {
return condition ? <Fragment>{children}</Fragment> : null
}