Skip to content

[PERFORMANCE ALERT] plz test with me for this issue: very long text cause laggy keyboard #92

@fukemy

Description

@fukemy

Hi, i have very long text, then it's cause app too laggy

Screen Shot 2022-07-15 at 11 58 07

as you can see, i typed too long text by pressing, the button send is can not able to click ( it' took about 4 second to clickable).
When remove mentions input props from InputText, it's work normaly without lag

Here is my. code:


const { textInputProps, triggers } = useMentions({
        value: text,
        onChange: setText, ==> I think this line cause laggy, because when every text char typed, it's cause re-render

        triggersConfig,
        patternsConfig,
    })

<TextInput 
            // value={this.props.text}
            maxLength={500}
            testID={this.props.placeholder}
            accessible 
            accessibilityLabel={this.props.placeholder}
            placeholder={this.props.placeholder}
            placeholderTextColor={this.props.placeholderTextColor}
            multiline={this.props.multiline}
            editable={!this.props.disableComposer}
            onChange={this.onContentSizeChange}
            onContentSizeChange={this.onContentSizeChange}
            onChangeText={this.onChangeText} 
            style={[
                styles.textInput,
                this.props.textInputStyle,
                {
                    height: this.props.composerHeight,
                    ...Platform.select({
                        web: {
                            outlineWidth: 0,
                            outlineColor: 'transparent',
                            outlineOffset: 0,
                        },
                    }),
                },
            ]}
            autoFocus={this.props.textInputAutoFocus}
            enablesReturnKeyAutomatically
            underlineColorAndroid='transparent'
            keyboardAppearance={this.props.keyboardAppearance}
            {...this.props.textInputProps}  =====> this line

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingv3Feature and fixes for the major v3 release

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions