Created
February 20, 2019 03:25
-
-
Save mauricioszabo/8492062b943710b193764904546aba74 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { app } from './js/test_cljs.core'; | |
| export default app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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