小编Jac*_*Lee的帖子

如何在apollo-link或apollo-client中禁用缓存?

我正在使用apollo-client,apollo-linkreact-apollo,我想完全禁用缓存,但不知道该怎么做.

我读了apollo-cache-inmemory它的源代码,它config的构造函数中有一个参数,但是我无法构建一个虚拟函数storeFactory来使它工作.

react-apollo

33
推荐指数
4
解决办法
2万
查看次数

如何配置反应原生android库使用npm安装react-native?

我正在编写一个android库,需要调用ReactInstanceManager.onHostResume,我的build.gradle文件内容是:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile "com.facebook.react:react-native:+"
}
Run Code Online (Sandbox Code Playgroud)

我将它安装到一个示例项目中npm install --save react-native-mylib,然后使用,编译项目react-native run-android,导致一些错误:

MyModuleActivity.java:107: error: cannot find symbol
      mReactInstanceManager.onHostPause();
                           ^
  symbol:   method onHostPause()
  location: variable mReactInstanceManager of type ReactInstanceManager
Run Code Online (Sandbox Code Playgroud)

我尝试找到已安装的react-native库:

find . -iname "*.jar"
...
./node_modules/react-native-mylib/android/build/intermediates/exploded-aar/com.facebook.react/react-native/0.20.1/jars/classes.jar
./node_modules/react-native-mylib/android/build/intermediates/exploded-aar/com.facebook.react/react-native/0.20.1/jars/libs/infer-annotations-1.5.jar
...
Run Code Online (Sandbox Code Playgroud)

似乎它从maven安装了react-native@0.20.1,这个版本的react-native没有onHostPause方法.

编辑:

在另一个链接某些库的项目中查找库,它们都是反应原生的旧版本:

$ find . -iname "*.jar" | grep com.facebook.react
./android/app/build/intermediates/exploded-aar/com.facebook.react/react-native/0.25.1/jars/classes.jar
./android/app/build/intermediates/exploded-aar/com.facebook.react/react-native/0.25.1/jars/libs/infer-annotations-1.5.jar
./android/app/build/intermediates/exploded-aar/com.facebook.react/react-native/0.26.0/jars/classes.jar …
Run Code Online (Sandbox Code Playgroud)

android react-native

9
推荐指数
1
解决办法
1311
查看次数

救援在红宝石中不起作用的原因是什么?

我正在调试一个问题simple_token_authentication,我修改了https://github.com/gonzalo-bulnes/simple_token_authentication/blob/master/lib/simple_token_authentication/sign_in_handler.rb#L7中的一些代码:

def sign_in(controller, record, *args)
  begin
    puts "=== TRACE 1"
    integrate_with_devise_trackable!(controller)
    puts "=== TRACE 2"
    controller.send(:sign_in, record, *args)
    puts "=== TRACE 3"
  rescue Exception => e
    puts "=== TRACE 4"
  ensure
    puts "=== TRACE 5"
  end
end
Run Code Online (Sandbox Code Playgroud)

输出:

Started GET "/projects" for ::1 at 2016-04-18 18:35:22 +0800
  ActiveRecord::SchemaMigration Load (0.1ms)  SELECT "schema_migrations".* FROM "schema_migrations"
Processing by ProjectsController#index as JSON
  Parameters: {"project"=>{}}
  User Load (0.2ms)  SELECT  "users".* FROM "users" WHERE "users"."email" = ?  ORDER BY "users"."id" ASC …
Run Code Online (Sandbox Code Playgroud)

ruby

0
推荐指数
1
解决办法
45
查看次数

标签 统计

android ×1

react-apollo ×1

react-native ×1

ruby ×1