Context default value is for cases without provider

This commit is contained in:
Juho Teperi 2018-05-04 18:14:48 +03:00
parent cb02310b68
commit 0c0ffc626a
1 changed files with 3 additions and 7 deletions

View File

@ -1197,16 +1197,12 @@
(fn [v]
(r/as-element [:div "Context: " v])))))))
;; FIXME: Why doesn't this work
#_
(testing "context default value works"
(is (= "<div>Context: default</div>"
(rstr (r/create-element
Provider #js {}
(r/create-element
Consumer #js {}
(fn [v]
(r/as-element [:div "Context: " v]))))))))
(r/as-element [:div "Context: " v])))))))
(testing "context works with adapt-react-class"
(let [provider (r/adapt-react-class Provider)