react-native - 使用 ClojureScript、Re-natal 和 React-Native 禁用 RTL?

标签 react-native clojure clojurescript re-frame re-natal

我正在开发一个基于 ClojureScript 和 React Native 的重生平台应用程序。我在 Android 平台上为我的应用程序禁用 RTL 时遇到问题。

这是在 react-native 中禁用 RTL 的代码,它工作得很好:

const ReactNative = require('react-native');

ReactNative.I18nManager.allowRTL(false); 

我认为这正是 cljs 中的上述代码:

(def ReactNative (js/require "react-native"))

(.allowRTL (.I18nManager ReactNative) false)

但是,我得到了这个错误:

“对象不是函数(评估'my-app.android.core.ReactNative.I18nManager())”

native react :“v0.50.3”

react :“16.0.0”

重新构建:“0.9.2”

clojurescript: "1.9.542"

clojure: "1.9.0-alpha16"

screenshot of error

最佳答案

I18nManagerReactNative 对象的字段(不是方法)。它应该像这样访问:(.-I18nManager ReactNative)。所以,相当于

ReactNative.I18nManager.allowRTL(false); 

会是

(.allowRTL (.-I18nManager ReactNative) false)

关于react-native - 使用 ClojureScript、Re-natal 和 React-Native 禁用 RTL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49030635/

相关文章:

javascript - 如何计算两组经纬度之间的距离

android - 为什么在 Android 上进行地理编码/反向地理编码需要许可?

android - "react-native log-android"错误 "adb' logcat -c "failed. adb' logcat -c 运行正常。 [Ubuntu]

android - react native Android : how to remove "overscroll effect" of ScrollView

java - 如何在 Clojure 中扩展 protected 方法

clojure - 使用 Clojure 进行大规模数据挖掘

jar - 如何运行 compojure 休息服务器?

javascript - 从 Javascript 调用 ClojureScript

javascript - 在线博彩游戏和安全 : How to?

Clojure + Clojurescript : Macro to read code of current file