Skip to content

TextInput does not match update until it receives focus #7638

@chrisglein

Description

@chrisglein

@chrisglein Okay so I created two fresh inits, one for 0.63 and one for 0.64. I replaced the App.tsx content with the following:

const App = () => {
  const [quantity, setQuantity] = React.useState<number>(0);
  return (
    <>
      <StatusBar barStyle="dark-content" />
      <SafeAreaView>
        <TextInput value={quantity.toString()} />
        <Button
          title={'Count Up'}
          onPress={() => {
            setQuantity(quantity + 1);
          }}
        />
      </SafeAreaView>
    </>
  );
};

I additionally recorded 2 small video showcases (mp4) of the problem and added it to Google-Drive. You can watch it here:

As you can see, the value shown by the textInput is not what it actually has registered as state. As soon as I type into the textInput it replaces the value with the correct one. After that, the count up button works.

This does definitely not align with iOS/Android/Web behaviour 🤷

Originally posted by @creambyemute in #4444 (comment)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions