mirror of
https://github.com/tonsky/rum.git
synced 2025-08-03 18:13:19 +08:00
add ^js typehint to React Context
This commit is contained in:

committed by
Nikita Prokopov

parent
57ddd0ee98
commit
67b40021c6
@ -363,9 +363,11 @@
|
||||
...)"
|
||||
[[context value] & body]
|
||||
(if (:ns &env)
|
||||
`(.createElement js/React (.-Provider ~context)
|
||||
(cljs.core/js-obj "value" ~value)
|
||||
~@(map #(compiler/compile-html % &env) body))
|
||||
(let [ctx (with-meta (gensym "ctx") {:tag 'js})]
|
||||
`(let [~ctx ~context]
|
||||
(.createElement js/React (.-Provider ~ctx)
|
||||
(cljs.core/js-obj "value" ~value)
|
||||
~@(map #(compiler/compile-html % &env) body))))
|
||||
`(binding [~context ~value]
|
||||
~@body)))
|
||||
|
||||
|
Reference in New Issue
Block a user