Skip to content

Input box is extremely slow if the state contains a large array #176

@think-in-universe

Description

@think-in-universe

If the component has an array type state which is has more than 500 or 1000 elements, the input box is really slow when you type.

Copy and paste below code to https://near.org/sandbox and it should be able to reproduce it.

State.init({
  data: Array(1000)
    .fill(0)
    .map((_, i) => ({
      id: i,
    })),
});

return (
  <div>
    <input onChange={(e) => State.update({ input: e.target.value })} />
  </div>
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions