Skip to content

Instantly share code, notes, and snippets.

@mhuebert
mhuebert / React Contexts with Reagent.md
Last active October 30, 2020 14:15
React contexts with Reagent

The following provide and consume Reagent components expose React contexts without fuss.

Example

(:require [example.reagent-context :as c])

;; in a component, use `provide` to supply values for contexts:
[c/provide {:app-theme {:color "blue"}}
 ;; consume one context at a time