From 97b8a57bdbbf462aaef807991eea22665f0662c9 Mon Sep 17 00:00:00 2001 From: wusuopu Date: Fri, 5 Feb 2016 16:29:17 -0800 Subject: [PATCH] Fix inspector for displaying styles' value Summary: StyleInspector will occur a error if a style's value is an object, such as transform. Now it converts the value to string before display. fix issue #5774 . Now it can display okay. ![simulator screen shot feb 6 2016 12 32 24 am](https://cloud.githubusercontent.com/assets/1478284/12852296/36736966-cc69-11e5-8f28-9e4681585bcb.png) Closes https://github.com/facebook/react-native/pull/5777 Reviewed By: svcscm Differential Revision: D2908135 Pulled By: nicklockwood fb-gh-sync-id: 5914f9e9538f90ae9a38ef7d8dc85b2df84ec43e --- Libraries/Inspector/StyleInspector.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Libraries/Inspector/StyleInspector.js b/Libraries/Inspector/StyleInspector.js index 702d01e1d..96d13ad6a 100644 --- a/Libraries/Inspector/StyleInspector.js +++ b/Libraries/Inspector/StyleInspector.js @@ -27,8 +27,12 @@ class StyleInspector extends React.Component { {names.map(name => {name}:)} + - {names.map(name => {this.props.style[name]})} + {names.map(name => { + var value = typeof this.props.style[name] === 'object' ? JSON.stringify(this.props.style[name]) : this.props.style[name]; + return {value}; + } ) } );