Skip to content

TextInput has performance issue in ^0.55 #18916

@armenbadalyan

Description

@armenbadalyan

Environment

Environment:
OS: macOS High Sierra 10.13.3
Node: 8.8.0
Yarn: 1.3.2
npm: 5.4.2
Watchman: 4.7.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: Not Found

Packages: (wanted => installed)
react: ^16.0.0 => 16.3.2
react-native: ^0.55.0 => 0.55.3

Steps to Reproduce

  1. Create a new project with react-native init
  2. Replace App.js content with the following code:
import React, { Component } from 'react';
import {    
    TextInput,    
    View
} from 'react-native';

type Props = {};
export default class App extends Component<Props> {
    state = {
        text: ''
    }

    onChangeText = (event) => {
        const { text } = event.nativeEvent
        this.setState({ text })
    }

    render() {
        return (<View>
            <TextInput value={this.state.text} onChange={this.onChangeText} />
        </View>);
    }
}
  1. Run the app on Android device with react-native run-android
  2. Type and clear some text into the TextInput several times

Expected Behavior

Input should perform the same after several type/clear cycles.

Actual Behavior

Input becomes laggy after a couple of type/clear cycles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions