Guest User

Untitled

a guest
Jun 21st, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. import { SFC, ReactElement } from "react";
  2.  
  3. export type MaybeProps = {
  4. value: boolean;
  5. children: ReactElement<any>;
  6. };
  7.  
  8. export const Maybe: SFC<MaybeProps> = ({
  9. value,
  10. children = null
  11. }) => (value && children) ? children : null;
Add Comment
Please, Sign In to add comment