From 3aa37450a07a0d7b7df8d966ce4fdbe4382085de Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Thu, 21 Sep 2017 14:04:41 -0700 Subject: [PATCH] Improve error message for text nodes in View --- src/components/View/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/View/index.js b/src/components/View/index.js index 17c0c532..c17a0a66 100644 --- a/src/components/View/index.js +++ b/src/components/View/index.js @@ -52,7 +52,10 @@ class View extends Component { if (process.env.NODE_ENV !== 'production') { React.Children.toArray(this.props.children).forEach(item => { - invariant(typeof item !== 'string', 'A text node cannot be a child of a '); + invariant( + typeof item !== 'string', + `Unexpected text node: ${item}. A text node cannot be a child of a .` + ); }); }