Skip to content

Instantly share code, notes, and snippets.

@mauricioszabo
Created February 20, 2019 03:25
Show Gist options
  • Select an option

  • Save mauricioszabo/8492062b943710b193764904546aba74 to your computer and use it in GitHub Desktop.

Select an option

Save mauricioszabo/8492062b943710b193764904546aba74 to your computer and use it in GitHub Desktop.
import { app } from './js/test_cljs.core';
export default app
;; shadow-cljs configuration
{:source-paths ["src" "test"]
:dependencies [[reagent "0.8.1" :exclusions [cljsjs/react]]]
:builds
{:app {:target :npm-module
:output-dir "js/"
:runtime :browser
:devtools {:devtools-url "http://<host-ip>:9630"}}}} ;; This will let client connect our machine, so that we can have a repl.
(ns test-cljs.core
(:require [reagent.core :as r]))
(def rn (js/require "react-native"))
(def View (-> rn .-View r/adapt-react-class))
(def Text (-> rn .-Text r/adapt-react-class))
(defn app []
(r/as-element
[View {:style {:justify-content "center"
:flex 1
:align-items "center"
:background-color "#fff"}}
[Text {:on-press #(js/alert "FOOBAR")}
"Foobar Bar"]]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment