reagent

A minimalistic ClojureScript interface to React.js http://reagent-project.github.io/
Greg Jeanmart 2020-04-13T12:54:23.153Z

Hi there, I was wondering if there is a way to access a custom environment variables like process.env.REACT_APP_API_KEY with reagent? Something similar to this functionality provided by react-script https://create-react-app.dev/docs/adding-custom-environment-variables/

juhoteperi 2020-04-13T12:58:35.154400Z

@greg851 Depends on the build tool, not really related to Reagent. With Cljs usually you'd use Closure defines to declare build time constants: https://clojurescript.org/reference/compiler-options#closure-defines and then you can set these from your build tool, maybe from env variables, like Shadow-cljs supports: https://shadow-cljs.github.io/docs/UsersGuide.html#shadow-env

👍 1
Greg Jeanmart 2020-04-13T13:00:02.154500Z

good point. I'm using shadow-cljs.