Closed shaunlebron closed 1 year ago
💙
thanks @shaunlebron ! I haven't been following the full conversation in slack; did you find out that this comment is in fact not true, and we can use the ^js
syntax inside of a syntax quote when emitting CLJS code?
@lilactown No, ^js
in a syntax-quote becomes ^<macro-ns>/js
, but this PR uses the explicit type ^js/React.Context
to pass symbol resolution.
If you’d like to verify that the typehint generates an extern, here’s a rough trace through the reader, macro evaluation, and cljs analyzer:
^js/React.Context ~context
=>
(clojure.core/with-meta context {:tag (clojure.core/quote js/React.Context)})
context
macro arg (i.e. symbol or list), attached with metadata {:tag js/React.Context}
:tag
metadata as a typehintohhhh interesting. Nice!
Fixes #103 and #104
Hi @lilactown, this is the only change needed for the above issues. Thank you! 🙏