From 0a85d31c139b8031cd9dc8b3d207eb23c868fb4f Mon Sep 17 00:00:00 2001 From: Darek Rossman Date: Thu, 27 Apr 2017 17:08:36 -0400 Subject: [PATCH] Fix error when component has object as props MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When attempting to render a component's props in the story source pane – when a component has an object for a prop like `style`, `previewProp()` was attempting to render a literal object with the key `content`, which causes a React error. Seems the intention of the original code was to render the literal characters `"{"` and `"}"` around `content`. --- packages/addon-info/src/components/PropVal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/addon-info/src/components/PropVal.js b/packages/addon-info/src/components/PropVal.js index f03af69feb4b..99b2efc30ce1 100644 --- a/packages/addon-info/src/components/PropVal.js +++ b/packages/addon-info/src/components/PropVal.js @@ -107,7 +107,7 @@ function previewProp(val) { } if (!braceWrap) return content; - return {{ content }}; + return {`{${content}}`}; } export default class PropVal extends React.Component {