Skip to content

Infinite loop when user is too fast with clicking #1780

@RyanLinXiang

Description

@RyanLinXiang

Describe the bug

We adapted the Vanilla package for our project to work with React (16.13.1) Native (0.63.4). The problem which occurs is when user is too fast with clicking on an UI element like a radio button, somehow this causes an infinite loop and the app crashs. The structure of the component looks like this:

class Parent {
  //... 
  
 @bind
 private onChange({errors, data}) {
    this.setState({errors, data});
  }

  public render() {
    <JsonForms
      //...
      onChange={this.onChange}
    />
  }
}

When I prevent the Parent component from rerendering (e.g. by using "shouldComponentUpdate") everytime onChange is called the infinite loop issue is gone. Also this issue does not occur when the user slowly clicks on UI elements. So any explanation for this behavior?

Expected behavior

There should be no infinite loop no matter how quick or how slow a user clicks on an UI element and triggers rerenderings within JsonForms/in its parent component

Steps to reproduce the issue

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Screenshots

No response

In which browser are you experiencing the issue?

React Native 0.63.4

Framework

React

RendererSet

Other (please specify in the Additional context field)

Additional context

We are using customized Vanilla package to work with React Native

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions