mirror of https://github.com/status-im/reagent.git
Context default value is for cases without provider
This commit is contained in:
parent
cb02310b68
commit
0c0ffc626a
|
@ -1197,16 +1197,12 @@
|
||||||
(fn [v]
|
(fn [v]
|
||||||
(r/as-element [:div "Context: " v])))))))
|
(r/as-element [:div "Context: " v])))))))
|
||||||
|
|
||||||
;; FIXME: Why doesn't this work
|
|
||||||
#_
|
|
||||||
(testing "context default value works"
|
(testing "context default value works"
|
||||||
(is (= "<div>Context: default</div>"
|
(is (= "<div>Context: default</div>"
|
||||||
(rstr (r/create-element
|
(rstr (r/create-element
|
||||||
Provider #js {}
|
Consumer #js {}
|
||||||
(r/create-element
|
(fn [v]
|
||||||
Consumer #js {}
|
(r/as-element [:div "Context: " v])))))))
|
||||||
(fn [v]
|
|
||||||
(r/as-element [:div "Context: " v]))))))))
|
|
||||||
|
|
||||||
(testing "context works with adapt-react-class"
|
(testing "context works with adapt-react-class"
|
||||||
(let [provider (r/adapt-react-class Provider)
|
(let [provider (r/adapt-react-class Provider)
|
||||||
|
|
Loading…
Reference in New Issue