Closed benjamin-asdf closed 5 months ago
Ah the repro doesn't have to do with case
. That is simply from 'b
.
here is the issue with form I have in real life:
(ns foo)
(defn Foo
[a]
(case (:optimistic-audio? audioItem)
#jsx [UploadedAudioCardOptimistic
{:description {:name audioItem}}]
#jsx [UploadedAudioCard {}]))
import * as squint_core from 'squint-cljs/core.js';
;
var Foo = function (a) {
let G__51481 = squint_core.get(audioItem, "optimistic-audio?");
if ((cljs.core.symbol("squint-compiler-jsx") === G__51481)) {
return <UploadedAudioCard></UploadedAudioCard>} else {
if (([UploadedAudioCardOptimistic, ({ "description": ({ "name": audioItem }) })] === G__51481)) {
return <UploadedAudioCard></UploadedAudioCard>} else {
if ("else") {
throw new Error(squint_core.str("No matching clause: ", G__51481))} else {
return null}}}
};
export { Foo }
this has to do with "squint-compiler-jsx" somehow.
Update: I just realized my issue is using case instead of cond
:sweat_smile:
tl;dr: the issue isn't with case or cond, but with using a symbol 'b
. squint (as of today) doesn't have symbols. just use a keyword or a string.
Additionally. In my second foo example there was an error, using {} instead of (). Then I got a react error "using object as child".
version 0.6.89
problem
Example code:
output:
-> ReferenceError: cljs is not defined