Dump An Object In React
Use this snippet:
Code
return (
<div>
<pre>{JSON.stringify(someObject, null, 2)}</pre>
</div>
)
To replace this:
Code
return (
<div>
{someData}
</div>
)
When you get errors like:
Code
Unhandled Runtime Error
Error: Objects are not valid as a React child (found: object with keys {displayTitle, primaryKey}). If you meant to render a collection of children, use an array instead.
Call Stack
throwOnInvalidObjectType