Answers for "Textinput react"

34

kill port ubuntu

sudo kill -9 `sudo lsof -t -i:9001`
Posted by: Guest on May-03-2020
15

ubuntu stop process on port

sudo kill -9 `sudo lsof -t -i:{PORT_NUMBER}`
Posted by: Guest on March-30-2020
0

kill port 3000 ubuntu

fuser -n tcp -k 9001
Posted by: Guest on October-05-2020
13

react native textinput

import React, { Component } from 'react';
import { TextInput } from 'react-native';

export default function UselessTextInput() {
  const [textInputValue, setTextInputValue] = React.useState('');

  return (
    <TextInput
      style={{ 
    	height: 40, 
    	borderColor: 'gray', 
    	borderWidth: 1,
    	placeholderTextColor: 'gray',
    }}
      onChangeText={text => setTextInputValue(text)}
      value={textInputValue}
	  placeholder="Insert your text!"
    />
  );
}
Posted by: Guest on May-02-2020
7

react native input

import React, { Component } from 'react';
import { TextInput } from 'react-native';

export default function UselessTextInput() {
  const [value, onChangeText] = React.useState('Useless Placeholder');

  return (
    <TextInput
      style={{ height: 40, borderColor: 'gray', borderWidth: 1 }}
      onChangeText={text => onChangeText(text)}
      value={value}
    />
  );
}
Posted by: Guest on April-17-2020
2

react native form input

import React, { useState } from 'react'
import * as rn from 'react-native'

const FormLogin = () => {
  const [value, setValue] = useState({
    username: '',
    password: ''
  })

  const onPress = () => {
    rn.Alert.alert(JSON.stringify(value))
    setValue({
      username: '',
      password: ''
    })
  }

  return (
    <rn.View style={styles.container}>
      <rn.Text style={styles.titleLogin}>Form Login</rn.Text>
      <rn.View style={styles.form}>
        <rn.TextInput
          style={styles.input}
          placeholder='enter username'
          placeholderTextColor='lightgrey'
          onChangeText={(text) => setValue({ ...value, username: text })}
          value={value.username}
          autoCompleteType='off'
        />
        <rn.TextInput
          style={styles.input}
          placeholder='enter password'
          placeholderTextColor='lightgrey'
          onChangeText={(text) => setValue({ ...value, password: text })}
          value={value.password}
          autoCompleteType='off'
          secureTextEntry
        />
        <rn.View style={styles.button}>
          <rn.Button title='login' color='green' onPress={onPress} />
        </rn.View>
      </rn.View>
    </rn.View>
  )
}

const styles = rn.StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'flex-start',
    alignItems: 'center',
    padding: 10,
    margin: 10
  },
  titleLogin: {
    fontSize: 22,
    textAlign: 'center',
    color: 'black',
    fontWeight: '600'
  },
  form: {
    width: '100%',
    height: 'auto',
    justifyContent: 'center',
    alignItems: 'center',
    padding: 5,
    marginTop: 5
  },
  input: {
    width: 350,
    height: 40,
    padding: 5,
    margin: 5,
    borderWidth: 1,
    borderColor: 'grey',
    borderStyle: 'solid',
    borderRadius: 3
  },
  button: {
    width: 360,
    height: 40,
    padding: 5,
    margin: 5,
    borderRadius: 3
  }
})

export default FormLogin
Posted by: Guest on October-09-2020
0

input text react 2020

function LoginForm() {
  const [email, setEmail] = React.useState("");
  const [password, setPassword] = React.useState("");

  const handleSubmit = (e: React.FormEvent) => {
    e.preventDefault();
    api.login(email, password);
  }
  return (
    <form onSubmit={handleSubmit}>
      <div>
      <label htmlFor="email">Email</label>
      <input
        type="email"
        id="email"
        value={email}
        onChange={(e) => setEmail(e.target.value)}
      />
      </div>
      <div>
      <label htmlFor="password">Password</label>
      <input
        type="password"
        id="password"
        value={password}
        onChange={(e) => setPassword(e.target.value)}
      />
      </div>
    </form>
  );
}
Posted by: Guest on October-19-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language