Skip to content

Instantly share code, notes, and snippets.

@ghaskins
Created October 15, 2019 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghaskins/02396da6a7ae7a3bfc2106b8166be76e to your computer and use it in GitHub Desktop.
Save ghaskins/02396da6a7ae7a3bfc2106b8166be76e to your computer and use it in GitHub Desktop.
(ns react-native.core
(:require [reagent.core :as r]
[react-native.utils :refer [adapt] :as u]))
(def app-registry (u/get-obj "AppRegistry"))
(def view (adapt "View"))
(def image (adapt "Image"))
(def touchable-highlight (adapt "TouchableHighlight"))
(def text (adapt "Text"))
(def flat-list (adapt "FlatList"))
(def safe-area-view (adapt "SafeAreaView"))
(defn alert [title]
(.alert (u/get-obj "Alert") title))
(defn register-componnet [name root]
(.registerComponent ^js app-registry name #(r/reactify-component root)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment