From 6f48895e0cf6ef166adc22b29203c24862d963f4 Mon Sep 17 00:00:00 2001 From: Ken Greeff Date: Fri, 22 Feb 2019 10:20:11 +1100 Subject: [PATCH] Check children is not null --- src/RevealBase.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RevealBase.js b/src/RevealBase.js index b7df761..4e02a1b 100644 --- a/src/RevealBase.js +++ b/src/RevealBase.js @@ -394,7 +394,7 @@ class RevealBase extends React.Component { getChild() { if (this.savedChild && !this.props.disabled) return this.savedChild; - if (typeof this.props.children === 'object') { + if (this.props.children && typeof this.props.children === 'object') { const child = React.Children.only(this.props.children); return (('type' in child) && typeof child.type === 'string') || this.props.refProp !== 'ref' ? child