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

These mostly don't work right if you put them inside a loop #4

Open
courtscribesinc opened this issue Jan 4, 2023 · 2 comments
Open

Comments

@courtscribesinc
Copy link

They should work if they are in a loop. Like a for loop or whatever. I'm sure I'm not the only person who has bumped up against this rather glaring issue.

@courtscribesinc
Copy link
Author

Think I found a temporary workaround for this, but it would be great to get it resolved. Here was my initial code:

for (let i = 0; i < users.length; i++) {
  currentId = useValue(users[0].id);
}

My workaround for this (which seems to work?) is this:

// for (let i = 0; i < users.length; i++) {
  currentId = useValue(users[0].id);
// }

This works fine except when there are no users in the database but that never happens. Would still be great to have a better solution...

@avocadatoria
Copy link
Contributor

@courtscribesinc if you do this, it will work like a charm, just one change to your code:

// for (let i = 0; i < users.length; i++) {
//  currentId = useValue(users[0].id);
// }

Peace.

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

2 participants