Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
How to change the border color of textinputs when typing in React Native

I have a TextInput in react native like this:

<SafeAreaView style={ChatWindowStyles.bottomAreaViewStyles}>
  <TextInput
    className="userMessageInput"
    style={ChatWindowStyles.messageTextInputStyles}
    placeholder="Enter a message"
    onChangeText={(text) => userMessage = (text)}
                
  />
</SafeAreaView> 

I want the border color to be blue when I am typing something in the TextInput. How can I do that?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

import React, { useState } from 'react'
import { SafeAreaView, View, TextInput, Text } from 'react-native'


export default function Example() {

    const [value, setValue] = useState('')
    const [isTextInputFocused, setTextInputFocused] = useState(false)

    return (
        <SafeAreaView style={{ flex: 1 }}>
            <View style={{ flex: 1, justifyContent: 'center', }}>
                <TextInput
                    value={value}
                    onChangeText={value => setValue(value)}
                    style={{ height: 60, width: '90%', marginLeft: '5%', borderColor: isTextInputFocused == true ? 'blue' : 'black', borderWidth: 1, borderRadius: 10, paddingLeft: 10 }}
                    placeholder='Enter text'
                    onFocus={() => setTextInputFocused(true)}
                    onSubmitEditing={() => setTextInputFocused(false)}
                    onEndEditing={() => setTextInputFocused(false)}
                />
            </View>
        </SafeAreaView>
    )
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!