Closed Bug 1400404 Opened 5 years ago Closed 5 years ago
React should expect a boolean or a number as the JSON data
59 bytes, text/x-review-board-request
http://searchfox.org/mozilla-central/rev/2c9a5993ac40ec1db8450e3e0a85702fa291b9e2/devtools/client/jsonview/components/main-tabbed-area.js#31 json: PropTypes.oneOfType([ PropTypes.string, PropTypes.object, PropTypes.array ]) http://searchfox.org/mozilla-central/rev/2c9a5993ac40ec1db8450e3e0a85702fa291b9e2/devtools/client/jsonview/components/json-panel.js#38 data: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, PropTypes.object ]) But the JSON data can also be a boolean or a number, e.g. data:application/json,true data:application/json,1234 With --enable-debug-js-modules, they produce a warning in the console. There is also null, but it seems that's already covered, probably by PropTypes.object.
Yep, good catch. Thanks for the report! Honza
Hi Honza, I was able to see that the following warnings go away with my patch applied. Warning: Failed prop type: Invalid prop `json` supplied to `MainTabbedArea`. in MainTabbedArea react-dev.js:22807 Warning: Failed prop type: Invalid prop `data` supplied to `JsonPanel`. in JsonPanel (created by MainTabbedArea) in MainTabbedArea Can you take a look at my changes?
Comment on attachment 8911072 [details] Bug 1400404 - Adding bool and number to list of PropTypes in Json-Panel. https://reviewboard.mozilla.org/r/182542/#review188762 Works for me, thanks Abhinav! Honza
Attachment #8911072 - Flags: review?(odvarko) → review+
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/5d5d1d227104 Adding bool and number to list of PropTypes in Json-Panel. r=Honza
Assignee: nobody → abhinav.koppula
You need to log in before you can comment on or make changes to this bug.