fix: avoid mapping Immutable.Map as React children (#6165)

Ref https://github.com/immutable-js/immutable-js/issues/667
This commit is contained in:
geraldglynn
2020-06-22 16:57:00 +01:00
committed by GitHub
parent c6f1c163fb
commit 93020e2803

View File

@@ -12,15 +12,15 @@ const Callbacks = (props) => {
return <span>No callbacks</span> return <span>No callbacks</span>
} }
let callbackElements = callbacks.map((callback, callbackName) => { let callbackElements = callbacks.entrySeq().map(([callbackName, callback]) => {
return <div key={callbackName}> return <div key={callbackName}>
<h2>{callbackName}</h2> <h2>{callbackName}</h2>
{ callback.map((pathItem, pathItemName) => { { callback.entrySeq().map(([pathItemName, pathItem]) => {
if(pathItemName === "$$ref") { if(pathItemName === "$$ref") {
return null return null
} }
return <div key={pathItemName}> return <div key={pathItemName}>
{ pathItem.map((operation, method) => { { pathItem.entrySeq().map(([method, operation]) => {
if(method === "$$ref") { if(method === "$$ref") {
return null return null
} }