I’m trying to run the package thheller/reagent-react-native
and I’m getting the following error upon running it
reagent-react-native-master % shadow-cljs watch app shadow-cljs - config: /Users/prikshetsharma/Desktop/reagent-react-native-master/shadow-cljs.edn shadow-cljs - updating dependencies shadow-cljs - dependencies updated running: npm install --save --save-exact react@16.9.0 react-dom@16.9.0 npm notice created a lockfile as package-lock.json. You should commit this file. + react-dom@16.9.0 + react@16.9.0 added 8 packages from 3 contributors and audited 8 packages in 0.993s found 0 vulnerabilities shadow-cljs - server version: 2.9.2 running at http://localhost:9630 shadow-cljs - nREPL server started on port 49573 shadow-cljs - watching build :app [:app] Configuring build. [:app] Compiling ... [:app] Build failure: The required namespace “shadow.react-native” is not available, it was required by “test/app.cljs”.
Here’s the code that’s throwing the error:
(ns http://test.app (:require [shadow.react-native :refer (render-root)] [“react-native” :as rn] [“react” :as react] [reagent.core :as r] ))
Where do I find the shadow.react-native namespace?
@ps in a newer shadow-cljs version. 2.9.2 is too old for that
on running
react-native run-ios
The app doesn’t run and there’s no app icon in the simulator
I need a way to detect which word was clicked in a body of text or which portion was selected/highlighted. I'd like to avoid putting a span
around every word. Anyone know anything I could use to make this easier?
I think you can achieve this by fiddling with (js/window .getSelection)
With quick googling I found a jsfiddle that does what you want in JavaScript. Translating that kind of stateful stuff to ClojureScript might be annoying. Or fun. 🙂 http://jsfiddle.net/Vap7C/15/
@valtteri thanks, I came across that earlier as well. Not sure if I'm familiar enough with cljs to give that a shot myself, but absent other options, I might have to give it a shot.