clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
zendevil 2020-12-13T06:13:38.287100Z

I’m trying to run the package thheller/reagent-react-native

zendevil 2020-12-13T06:13:48.287400Z

and I’m getting the following error upon running it

zendevil 2020-12-13T06:14:09.287600Z

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”.

zendevil 2020-12-13T06:14:33.287900Z

Here’s the code that’s throwing the error:

zendevil 2020-12-13T06:14:34.288100Z

(ns http://test.app (:require [shadow.react-native :refer (render-root)] [“react-native” :as rn] [“react” :as react] [reagent.core :as r] ))

zendevil 2020-12-13T06:14:52.288600Z

Where do I find the shadow.react-native namespace?

thheller 2020-12-13T09:39:19.289Z

@ps in a newer shadow-cljs version. 2.9.2 is too old for that

zendevil 2020-12-13T11:24:19.289500Z

on running

react-native run-ios

zendevil 2020-12-13T11:24:23.289600Z

zendevil 2020-12-13T11:25:29.290300Z

The app doesn’t run and there’s no app icon in the simulator

2020-12-13T14:24:27.292Z

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?

valtteri 2020-12-13T19:45:07.292700Z

I think you can achieve this by fiddling with (js/window .getSelection)

valtteri 2020-12-13T19:47:03.292900Z

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/

2020-12-13T19:51:55.293200Z

@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.