我集成了react-apollo,用于将我的GraphQL服务器中的数据提取到我的react本机应用程序中.我使用redux-perist来持久化和再水化redux商店.
但我不知道如何补充我的阿波罗州.
谁知道我怎么能这样做?
谢谢
问题
在我的反应本机应用程序中,我想启动一个名为“Taco Shop”的外部应用程序。我正在使用包react-native-app-link。我想从我的应用程序内启动此应用程序,但如果未安装,请将用户带到应用程序商店。
代码
var url = "tacoshop://"; <-----NO CLUE WHERE OR HOW I GET THIS URL
var appName = 'Taco Shop';
var appStoreId = 'id1185454813';
var playStoreId = 'io.simplyorder.tacoshop';
AppLink.maybeOpenURL(url, { appName, appStoreId, playStoreId }).then(() => {
// do stuff
})
.catch((err) => {
// handle error
});
Run Code Online (Sandbox Code Playgroud)
它会启动 google play/应用程序商店,但在安装时不会启动实际的应用程序。如果已安装,如何找到上面的 taco shop 应用程序的 URL 以直接启动?
borderRadius 在 iOS 中按预期工作,但在 Android 中不按预期工作。我试图包裹Image在一个视图,并给borderRadius和overFlow: 'hidden'
<View style={styles.userImageContainer}>
<Image source={require('../../assets/images/user1.png')}
style={styles.userImage}
/>
</View>
Run Code Online (Sandbox Code Playgroud)
样式表
const imageSize = 40;
userImageContainer: {
height: imageSize,
width: imageSize,
borderWidth: 1,
alignItems: 'center',
justifyContent: 'center',
borderRadius: imageSize/2,
overflow: 'hidden'
},
userImage: {
height: imageSize,
width: imageSize,
borderRadius: imageSize/2,
padding: 5,
resizeMode: 'contain'
},
Run Code Online (Sandbox Code Playgroud)
最终结果图像
我正在使用 RN 0.42.2
在TextInput中输入电子邮件时,它应根据输入的电子邮件是否有效来验证并显示错误消息?我正在使用tcomb表单验证.如何以tcomb形式添加电子邮件验证?下面是代码.
import React, { Component } from 'react';
import {
AppRegistry,
Text,
Image,
View,
Button,
StyleSheet,
TextInput,
Linking,
Alert,
Navigator
} from 'react-native';
import t from 'tcomb-form-native';
const Form = t.form.Form;
// here we are: define your domain model
const LoginFields = t.struct({
username: t.String, // a required string
password: t.String, // a required string
});
const options = {
fields: {
password: {
type: 'password',
placeholder: 'Password',
},
username: {
placeholder: 'e.g: abc@gmail.com',
error: 'Insert a valid email'
} …Run Code Online (Sandbox Code Playgroud)