有没有人为 react-native-tab-view 编写过单元测试?我需要模拟道具 onIndexChanged 和 TabBar 的 getLabelText。这是我们的模拟
import React from 'react';
import { View } from "react-native";
export class TabView extends View {
render = function () {
return <View>
{this.props.renderTabBar()}
{Object.values(this.props.renderScene)
.map((scene, i) => <View key={i}>{scene()}</View>)}
</View>;
};
};
export const TabBar = View;
export const SceneMap = map => map;
Here is the TabView we are using. Any help is really appreciated. Run Code Online (Sandbox Code Playgroud)
<TabView
navigationState={this.state}
renderScene={SceneMap({
current: () => <TorViewCurrent
torCurrentList={this.props.torCurrentList}
torCurrentListLoading={this.props.isLoading || this.props.torCurrentListLoading}
torCurrentListLoaded={this.torCurrentListLoaded}
torCurrentListError={this.props.torCurrentListError}
torStatusMap={this.props.torStatusMap}
torReasonMap={this.props.torReasonMap} …Run Code Online (Sandbox Code Playgroud)有没有一种方法可以使用Android和iOS的本机反应进行扫描并全部获取Wifi列表。我看过一些库,但大多数是android库,甚至那些库也无法正常工作。有什么建议么?
如果我需要编写本机模块,可以为我指出正确的方向。以前从未写过React Native的本地模块。