Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react';
- import {
- AppRegistry,
- StyleSheet,
- Text,
- ScrollView,
- TextInput,
- View ,
- } from 'react-native';
- var styles = require('./Style/customStyle');
- import Button from 'react-native-button';
- import RadioButton from 'react-native-radio-button'
- class AwesomeProject extends Component {
- constructor(props){
- super(props)
- this.state = {
- username: '',
- password: '',
- }
- }
- render() {
- return (
- <ScrollView style={styles.content}>
- <View style={styles.content}>
- <Text style={styles.welcome}>
- Create Account
- </Text>
- <Text style={styles.textStyle}>
- Name
- </Text>
- <TextInput
- style={styles.textInputStyle}
- placeholder="Enter Name"
- returnKeyLabel = {"next"}
- onChangeText={(text) => this.setState({text})}
- />
- <Button style={styles.buttonStyle}>
- Submit
- </Button>
- </View>
- </ScrollView>
- );
- }
- }
- AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);
- <TextInput
- style={styles.textInputStyle}
- placeholder="Enter Name"
- returnKeyLabel = {"next"}
- onChangeText={(text) => this.setState({text})}
- />
- <Button
- onPress={() => function }>
- class AwesomeProject extends Component {
- constructor(props){
- super(props)
- this.state = {
- username: '',
- password: '',
- }
- }
- _handlePress() {
- console.log(this.state.username);
- console.log(this.state.password);
- }
- render() {
- return (
- <ScrollView style={styles.content}>
- <View style={styles.content}>
- <Text style={styles.welcome}>
- Create Account
- </Text>
- <Text style={styles.textStyle}>
- Name
- </Text>
- <TextInput
- style={styles.textInputStyle}
- placeholder="Enter Name"
- returnKeyLabel = {"next"}
- onChangeText={(text) => this.setState({username:text})}
- />
- <Text style={styles.textStyle}>
- Name
- </Text>
- <TextInput
- style={styles.textInputStyle}
- placeholder="Enter Name"
- returnKeyLabel = {"next"}
- onChangeText={(text) => this.setState({password:text})}
- />
- <Button
- onPress={() => this._handlePress()}
- style={styles.buttonStyle}>
- Submit
- </Button>
- </View>
- </ScrollView>
- );
- }
- }
- constructor(){
- super();
- this.state = {isLoggedIn : false, email :"", password : ""};
- }
- render() {
- return (
- <View style={styles.container}>
- <TextInput style={styles.input}
- placeholder = "Username"
- returnKeyType = "next"
- underlineColorAndroid='transparent'
- onChange = {(text) => this.setState({email : text})}
- />
- <TextInput style={styles.input}
- secureTextEntry
- returnKeyType= 'go'
- onChange = {(password) => this.setState({password : password})}
- placeholder = "password"/>
- <TouchableOpacity style={styles.clickContainer} onPress=
- {this.login.bind(this)}>
- <Text style={styles.buttonText} >Login</Text>
- </TouchableOpacity>
- </View>
- );
- }
- login(){
- console.log(this.state.email);
- this.setState({isLoggedIn : true});
- }
- <Button
- style={styles.textInputStyle}
- onPress={() => console.log(this.state.username)}>
- Submit
- </Button>
- this.state = {
- username: '',
- password: '',
- name: ''
- }
- import React, { Component } from 'react';
- import {
- AppRegistry,
- StyleSheet,
- Text,
- ScrollView,
- TextInput,
- View ,
- } from 'react-native';
- var styles = require('./Style/customStyle');
- import Button from 'react-native-button';
- import RadioButton from 'react-native-radio-button'
- class AwesomeProject extends Component {
- constructor(props){
- super(props)
- this.state = {
- username: '',
- password: '',
- }
- }
- onUsernameChange(username) {
- let s = this.state;
- s.username = username;
- this.setState(s);
- }
- onPasswordChange(password) {
- let s = this.state;
- s.password = password;
- this.setState(s);
- }
- render() {
- return (
- <ScrollView style={styles.content}>
- <View style={styles.content}>
- <Text style={styles.welcome}>
- Create Account
- </Text>
- <Text style={styles.textStyle}>
- Name
- </Text>
- <TextInput
- style={styles.textInputStyle}
- placeholder="Enter Username"
- returnKeyLabel = {"next"}
- onChangeText={this.onUsernameChange}
- />
- <TextInput
- style={styles.textInputStyle}
- placeholder="Enter Password"
- returnKeyLabel = {"next"}
- onChangeText={this.onPasswordChange}
- />
- <Button style={styles.buttonStyle}>
- Submit
- </Button>
- </View>
- </ScrollView>
- );
- }
- }
- AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);
- <Button
- onPress={()=>Alert.alert(this.state.text1)}
- title="Press Me"
- color="#841584"
- />
Add Comment
Please, Sign In to add comment