From d8d562af691237bffa317c9d08e9d56386d471f8 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Sun, 18 Mar 2018 14:21:56 +1100 Subject: [PATCH] if for children on body section --- public/components/sections/BodySection.jsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/public/components/sections/BodySection.jsx b/public/components/sections/BodySection.jsx index 436193a..03bd90d 100644 --- a/public/components/sections/BodySection.jsx +++ b/public/components/sections/BodySection.jsx @@ -18,13 +18,21 @@ class BodySection extends React.Component { } render() { + let children; + + if(this.props.children) { + children = ( +
+ {this.props.children} +
+ ); + } + return (
{ this.props.title } -
- {this.props.children} -
+ { children }
)