Arrays and objects are shown as string
See original GitHub issue🐛 Bug Report
Hi, I’m starting to use Flipper in my React Native project. When I log an object like:
{
"glossary": {
"title": "example glossary",
"GlossDiv": {
"title": "S",
"GlossList": {
"GlossEntry": {
"ID": "SGML",
"SortAs": "SGML",
"GlossTerm": "Standard Generalized Markup Language",
"Acronym": "SGML",
"Abbrev": "ISO 8879:1986",
"GlossDef": {
"para": "A meta-markup language, used to create markup languages such as DocBook.",
"GlossSeeAlso": ["GML", "XML"]
},
"GlossSee": "markup"
}
}
}
}
}
It’s shown as a string.
I don’t want to use debugger in my browser but browser shows it as which is very usefull for nested objects. Will you planning this feature ?
Environment
Issue Analytics
- State:
- Created 3 years ago
- Reactions:38
- Comments:7 (2 by maintainers)
Top Results From Across the Web
If an array of Object is an Object, why is an array of String not a ...
array is an collection of objects or collection of primitive datatypes while string is a sequence of characters. as you know object is...
Read more >Data Structures: Objects and Arrays - Eloquent JavaScript
Every string has a toUpperCase property. When called, it will return a copy of the string in which all letters have been converted...
Read more >Array - JavaScript - MDN Web Docs
Returns a string representing the calling array and its elements. Overrides the Object.prototype.toString() method. Adds one or more elements ...
Read more >Java String Array- Tutorial With Code Examples
String array is an array of objects. This is because each element is a String and you know that in Java, String is...
Read more >Arrays of Objects | Think Java | Trinket
Just as you can create an array of String objects, you can create an array of Card objects. The following statement creates an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, we intend to support better object representations like that partially in the future, although it will probably not give the same experience, because the browser connects to the living objects, and can evaluate them lazily when they are being expanded and show the underlying part, while the Flipper integration has to serialize them (the log connection is unidirectional at this moment), but an serialized can grow unbounded large.
A simple solution might be to use
console.log(JSON.stringify(object, null, 2))
. Whether that works depends on the serializability of your object.JSON is now formatted in the logs plugin, but beyond that no improvements like lazily expanding objects and such are planned.