Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
think-in-universe opened this issue Feb 8, 2024 · 0 comments
Open

Comments

@think-in-universe
Copy link

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>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant