UNPKG

react-conditional-rendering

Version:

A React component library that helps in conditional rendering.

10 lines (7 loc) 297 B
import React, { Fragment } from 'react'; // Components are functions, and they must start with a capital letter function RenderIf({ children, condition }) { return condition && <Fragment> {children}</Fragment>; } // This export will be picked up in ./index.js export default RenderIf;