Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

57
Visualizações
Cant write more than one letter in TextInput

Im unable to write more than one letter in the text input.

I have tried to run after clearing the cache expo r -c

Does anyone has any idea why is this happening and how to fix it.

Running with

"expo": "^44.0.5", "react": "17.0.1", "react-dom": "17.0.1", "react-native": "0.64.3",

const Posts = () => {

    const isDarkMode = useColorScheme() === 'dark'

    const [search, setSearch] = useState('')
    const [refresh, setRefresh] = useState(false);

    const handleOnEndReach = () => {

    }

    const handleRefresh = () => {
        setRefresh(true)
        setTimeout(() => {
            setRefresh(false)
        }, 3000)
    }

    return (
        <TouchableWithoutFeedback
            onPress={() => Keyboard.dismiss()}
            style={{flex: 1, backgroundColor: isDarkMode ? colors.dark.background : colors.light.background}}
        >
            <FlatList
                ListHeaderComponent={() => 
                    <TextInput
                        value={search}
                        onChangeText={setSearch}
                        style={{padding: '2.5%'}}
                        keyboardAppearance={isDarkMode ? 'dark' : 'light'}
                        placeholder='Search...'
                        
                    />
                }
                style={{padding: '2.5%'}}
                onEndReached={handleOnEndReach}
                onEndReachedThreshold={0.5}
                refreshControl={
                    <RefreshControl refreshing={refresh} onRefresh={handleRefresh} tintColor={isDarkMode ? 'white' : 'black'}/>
                }
            />
        </TouchableWithoutFeedback>
    )
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

use defaultValue instead of value, I would write something like this:

function App() {
  const [input, setInput] = React.useState("")
  
  function handleChange(e) {
    e.preventDefault();
    setInput(e.target.value)
  }

  return (
    <input className="text-input" defaultValue={input} onChange={handleChange(e)}/>
  )
}

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda