小编jsc*_*uss的帖子

RN博览会:分离vs弹出

我目前有一个使用Expo构建在React Native中的应用程序(create-react-native-app),该应用程序需要一些本机代码。据我了解,有两个选项可用于下拉到纯本机反应,弹出和分离。到现在为止,我已经使用了相当数量的Expo API,因此必须分离到ExpoKit。我的理解正确吗,如果我纯粹弹出(而不是与ExpoKit分离),那么我使用的当前Expo工具将无法工作?

感谢任何反馈!

react-native expo create-react-native-app

6
推荐指数
1
解决办法
2249
查看次数

React Native:迁移到AndroidX

我今天运行我的Android RN项目,但遇到以下错误

Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
  Program type already present: android.support.v4.app.INotificationSideChannel$Stub
Run Code Online (Sandbox Code Playgroud)

我相信为了解决此问题,需要迁移到AndroidX。

我备份了我的项目,并尝试使用Android Studio无效。我也尝试过在gradle.properties文件中手动设置

android.enableJetifier=true
android.useAndroidX=true
Run Code Online (Sandbox Code Playgroud)

之后,我尝试从我的app / build.gradle中删除支持的库,并将目标设置targetSdkVersion为28。

这些尝试给我带来了更多错误,特别是这一次

Execution failed for task ':react-native-navigation:compileReactNative57_5DebugJavaWithJavac'.

我在Wix Navigation V2中使用React Native 0.58.6。帮助将不胜感激

android android-studio react-native react-native-navigation

5
推荐指数
1
解决办法
2972
查看次数

合并RXJS可观察变量,但等待第一个开始发射值

我有一个视频播放器事件流,当按下某些事件(例如暂停或播放)时会触发该流。该流来自使用CombineLatest的两个可观察对象,每当发出事件时都将抓住当前视频位置。

我需要每10秒钟发出另一个事件,然后将其投入混合。一切工作正常,但是ping $可观察值在发出第一个events值之前开始发出事件,这是标志玩家已加载的事件,并且可能记录了所有其他事件。

如何将ping $和events $合并到一个流中,但是只有在event $开始发出值后才让ping $开始?

const events$ = mediaStreams.events$;
const currTime$ = mediaStreams.currentTime$;

const intervalSource$ = interval(2000);
const ping$ = intervalSource$.pipe(map(() => "ping"));

const concatEvents$ = merge(events$, ping$);


const combined = concatEvents$.pipe(
 withLatestFrom(currTime$),
   map(([first, second]) => {
    return {
       event: first,
       position: second
     }
  })
)


combined.subscribe(val => console.log('COMBINED', val));
Run Code Online (Sandbox Code Playgroud)

谢谢

javascript reactive-programming rxjs

2
推荐指数
1
解决办法
34
查看次数