Fork me on GitHub
#clojurescript
<
2020-12-13
>
zendevil.eth06:12:38

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

zendevil.eth06:12:48

and I’m getting the following error upon running it

zendevil.eth06:12:09

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 [email protected] [email protected] npm notice created a lockfile as package-lock.json. You should commit this file. + [email protected] + [email protected] 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.eth06:12:33

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

zendevil.eth06:12:34

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

zendevil.eth06:12:52

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

thheller09:12:19

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

zendevil.eth11:12:19

on running

react-native run-ios

zendevil.eth11:12:29

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

Buidler14:12:27

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?

valtteri19:12:07

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

valtteri19:12:03

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/

Buidler19:12:55

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