{
"$type": "site.standard.document",
"canonicalUrl": "https://numergent.com/2016-09/Tip-Uncaught-Invariant-Violation.html",
"path": "/2016-09/Tip-Uncaught-Invariant-Violation.html",
"publishedAt": "2016-09-26T06:48:30.000Z",
"site": "at://did:plc:cf6futaebyc2k4wgzsr4v42k/site.standard.publication/3mp2ewx43js2g",
"tags": [
"clojurescript",
"react",
"reagent",
"bootstrap",
"tips"
],
"textContent": "> Uncaught Invariant Violation: onlyChild must be passed a children with exactly one child.\n\nAre you using Reagent and Bootstrap with ClojureScript, and getting this error?\n\nIn my case, the cause was that I had a when inside an OverlayTrigger. Seems like a no-no. Further testing showed you can't have an if either. Looks like OverlayTrigger can only wrap data, not something that might change.\n\nIn my case the solution was simple enough, once I figured out the cause: I just extracted when to wrap the OverlayTrigger, instead of the other way around.",
"title": "Tip: Uncaught Invariant Violation"
}