我正在使用反应导航 5:
我创建了 MainStackScreen 和 AuthStackScreen,
const AuthStack = createStackNavigator();
function AuthStackScreen() {
return (
<AuthStack.Navigator headerMode="none">
<AuthStack.Screen name="Main" component={Main} />
<AuthStack.Screen name="Login" component={Login} />
<AuthStack.Screen name="Registration" component={Registration} />
<AuthStack.Screen name="Home" component={DrawerNavigator} />
<AuthStack.Screen name="Notifications" component={Notifications} />
<AuthStack.Screen name="SmsValidation" component={SmsValidation} />
<AuthStack.Screen name="MoreRegistrationInfo" component={MoreRegistrationInfo} />
</AuthStack.Navigator>
);
}
Run Code Online (Sandbox Code Playgroud)
主堆栈屏幕:
const MainScreen = createStackNavigator();
function MainStackScreen({navigation}) {
return (
<MainScreen.Navigator>
<MainScreen.Screen name="Main" component={Main} />
<MainScreen.Screen name="SmsValidation" component={SmsValidation} />
<MainScreen.Screen name="MoreRegistrationInfo" component={MoreRegistrationInfo} />
</MainScreen.Navigator>
);
}
Run Code Online (Sandbox Code Playgroud)
我想防止在登录我的屏幕之间执行 IOS 滑动操作
我想创建一个模拟来替换资源:
$gateway = $this->getMockBuilder('PaymentGateway')
->setMethods(['transfer'])
->getMock();
Run Code Online (Sandbox Code Playgroud)
我收到这个警告:
方法“setMethods”已弃用
我该如何解决这个弃用问题?
我尝试使用 react native 基本消息传递和 react native 推送通知库来获取 android 设备令牌以发送推送通知:
我在 AndroidManifest.xml 中添加了配置:
...
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<!-- < Only if you are using GCM or localNotificationSchedule() > -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission
android:name="${applicationId}.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
<!-- < Only if you are using GCM or localNotificationSchedule() > -->
...
Run Code Online (Sandbox Code Playgroud)
在我的 App.js 中
// ----- COMPONENT DID MOUNT ---- //
async componentDidMount() {
// ====================================================== //
// ====================================================== //
// ====================================================== //
const granted …
Run Code Online (Sandbox Code Playgroud) android token push-notification react-native firebase-cloud-messaging
我使用 react native 创建一个移动应用程序。我使用 KeyboardAvoidingView、SafeAreaView 和 ScrollView 处理屏幕中的键盘位置。我使用这个命令来管理键盘位置:
<KeyboardAvoidingView style={{ flex: 1 }} behavior="padding" enabled>
<SafeAreaView>
<ScrollView>
<Header
leftComponent={{
icon: "cancel",
color: "#fff",
size: 30,
onPress: () => navigate("Dashboard")
}}
centerComponent={{ text: "Ajouter une demande", style: { color: "#fff", fontSize: 18 } }}
rightComponent={{
icon: "help",
color: "#fff",
size: 30,
fontWeight: "bold",
onPress: () => Alert.alert("En cours de développement")
}}
backgroundColor="rgba(82, 159, 197, 1)"
// outerContainerStyles={{ height: Platform.OS === "ios" ? 70 : 70 - 24 }}
containerStyle={
{
// …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 jest 编写 Angular 测试:
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [BookListComponent],
}).compileComponents();
}));
Run Code Online (Sandbox Code Playgroud)
当我启动时:
npm run test:watch
Run Code Online (Sandbox Code Playgroud)
我收到这个错误:
错误 TS2304:C 找不到名称“async”。
我正在使用 React Chart JS 在我的组件中显示一个甜甜圈。
"chart.js": "^3.7.1",
"react-chartjs-2": "^4.1.0",
Run Code Online (Sandbox Code Playgroud)
我无法显示标题:
const data = {
labels: ["Score", "Total"],
datasets: [
{
label: "Indice d'impact global de la transaction",
data: [3.7, 5],
backgroundColor: ["rgba(54, 162, 235, 0.2)", "rgba(128,128,128,0.2)"],
borderColor: ["rgba(54, 162, 235, 1", "rgba(128,128,128,1)"],
borderWidth: 1,
lineTension: 0.5,
},
],
};
<Doughnut
options={{
plugins: {
title: {
display: true,
text: "Indice d'impact global de la transaction",
align: "center",
padding: {
top: 10,
bottom: 30,
},
},
legend: {
display: true,
position: "top", …
Run Code Online (Sandbox Code Playgroud) 我迁移我的博览会项目以响应本机项目。我删除了 expo 并尝试使用本机方式添加启动画面和推送通知,并在没有 expo 的情况下添加字体。我还在没有博览会的情况下使用本机方式安装了反应导航。我使用 android studio 和 Xcode 运行该项目。我有一些问题,但我通过修复我的 package.json 文件中的一些包版本来修复它们现在我收到这个错误:
Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See ... for details.
* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: ***
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ …
Run Code Online (Sandbox Code Playgroud) react-native ×4
android ×1
angular ×1
chart.js ×1
expo ×1
ios ×1
javascript ×1
jestjs ×1
jsx ×1
keyboard ×1
php ×1
phpunit ×1
reactjs ×1
safeareaview ×1
scroll ×1
testing ×1
token ×1
typescript ×1