Closed
Bug 1400404
Opened 8 years ago
Closed 8 years ago
React should expect a boolean or a number as the JSON data
Categories
(DevTools :: JSON Viewer, enhancement, P3)
DevTools
JSON Viewer
Tracking
(firefox57 fix-optional, firefox58 fixed)
RESOLVED
FIXED
Firefox 58
| Tracking | Status | |
|---|---|---|
| firefox57 | --- | fix-optional |
| firefox58 | --- | fixed |
People
(Reporter: Oriol, Assigned: abhinav.koppula)
Details
(Keywords: good-first-bug)
Attachments
(1 file)
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.
Comment 1•8 years ago
|
||
Yep, good catch. Thanks for the report!
Honza
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 3•8 years ago
|
||
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 4•8 years ago
|
||
| mozreview-review | ||
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 jodvarko@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5d5d1d227104
Adding bool and number to list of PropTypes in Json-Panel. r=Honza
Comment 6•8 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58
Updated•8 years ago
|
Assignee: nobody → abhinav.koppula
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•