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

A potential infinite loop in example landing #680

Open
addlistener opened this issue Jul 22, 2024 · 0 comments
Open

A potential infinite loop in example landing #680

addlistener opened this issue Jul 22, 2024 · 0 comments

Comments

@addlistener
Copy link

addlistener commented Jul 22, 2024

Describe the bug
When process.env.NODE_ENV === 'production' setOptions are constantly changing, causing infinite loop.

Expected

It's fine when process.env.NODE_ENV === 'development'. When I logged all the actions
image
Only one setOptions is found, triggered from requestAnimationFrame in Viewport, which is expected.

setTimeout(() => {
setOptions((options) => {
options.enabled = true;
});

Not expected

when process.env.NODE_ENV === 'production'.
image
Extra setState is triggered from the below code, causing infinite loop

context.actions.setOptions((editorOptions) => {
editorOptions.enabled = options.enabled;
});

To Reproduce
Working on it. Changed so many things I need to remove the unnecessary parts.

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