Я работал над развертыванием реактивного проекта, который прекрасно работал (и продолжает работать) на симуляторах ios и android. Я недавно развернул его в бета-версии в playstore и testflight, и когда мы запускаем приложение, кажется, что отсутствует какой-то заполнитель и текст по умолчанию :-(
Я новичок в реактивной разработке, поэтому любые советы очень ценятся. Может быть, я что-то упускаю при создании пакета приложения? Я использую реагировать родной: 0,55,4. Ниже приведен код на странице входа в систему, где отсутствуют метки и входные данные не передаются на следующую страницу.
.
,
.
constructor(props) {
super(props);
this.state = {
username: '',
password: '',
isJobOwner: false,
saveCredentials: false,
isLoading: false
};
}
.
,
.
onPressLogin() {
this.props.navigation.navigate('SignUpChoice', {
data: {
username: this.state.username,
password: this.state.password
}
});
}
.
,
.
<Form style={styles.loginForm}>
<View style={styles.formInputs}>
<UnderlinedInput floating={true} label={'Email'} value={this.state.username}
onChangeText={(username) => this.setState({username})}
keyboardType={'email-address'} autoCapitalize={'none'}/>
<UnderlinedInput floating={true} label={'Password'} value={this.state.password}
onChangeText={(password) => this.setState({password})}
secureTextEntry={true}
autoCapitalize={'none'}/>
</View>
<View style={styles.formButtons}>
<Button transparent
onPress={() => this.onPressForgotPassword()}
disabled={this.state.isLoading} style={styles.forgotButtonStyle}><Text
style={styles.forgotTextStyle}>Forgot
Password?</Text></Button>
<Button primary style={styles.loginButtonStyle} onPress={() => this.onPressLogin()}
disabled={this.state.isLoading}>
<Text style={styles.loginTextStyle}>Sign In</Text>
</Button>
</View>
.
,
.
function mapStateToProps(state) {
const data = state.data.loginReducer;
return {
requesting: data.requesting,
successful: data.successful,
errors: data.errors,
isJobOwner: data.isJobOwner
}
}
.
,
.
export default connect(mapStateToProps)(LoginScreen);
Это нормально работает на симуляторах, но на устройствах, как будто состояние не обновляется.
Редактировать: включая источник для подчеркнутого ввода
import React from 'react';
import {Item, Input, Label} from 'native-base';
import colors from 'Colors';
const UnderlinedInput = ({defaultValue, label, value, onChangeText, secureTextEntry, keyboardType, autoCapitalize, floating, onEndEditing}) => {
return (
<Item floatingLabel={floating} stackedLabel={!floating} style={styles.inputTextStyle}>
<Label style={styles.labelStyle}>{label}</Label>
<Input
secureTextEntry={secureTextEntry || false}
autoCorrect={false}
autoCapitalize={autoCapitalize || 'words'}
value={value}
onChangeText={onChangeText}
keyboardType={keyboardType || 'default'}
defaultValue={defaultValue}
onEndEditing={onEndEditing}
style={styles.inputMainStyle}
/>
</Item>
);
}; * 1 027 *
const styles = {
inputTextStyle: {
borderBottomColor: colors.lightGrey,
borderBottomWidth: 1,
color: colors.lightGrey,
width: '80%',
marginLeft: 'auto',
marginRight: 'auto',
paddingBottom: 10
},
inputMainStyle: {
color: colors.lightGrey,
fontSize: 14
},
labelStyle: {
fontWeight: '700',
letterSpacing: 1,
paddingTop: 4,
color: colors.lightGrey,
fontSize: 14
}
};
экспорт по умолчанию UnderlinedInput;