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

fix: pid setup fix #220

Merged
merged 2 commits into from
Nov 21, 2024
Merged

fix: pid setup fix #220

merged 2 commits into from
Nov 21, 2024

Conversation

janrtvld
Copy link
Contributor

@janrtvld janrtvld commented Nov 20, 2024

Not an ideal fix, still thinking how we can do it better.

The problem is that because we now do () => , it re-renders everytime something changes in the properties passed to that screen. This means that once the state changes after the scan is complete, the screen renders again, and it triggers again.

I tried fixing it with useMemo but that leads to the same thing.

  • PIN screen still is a bit weird.

Signed-off-by: Jan <[email protected]>
@TimoGlastra
Copy link
Member

Ah interesting. I think we can fix that by using keys maybe? It's now anonymous.

Reason i added it is because it would render screens before the required data was there.

But what if we just render conditionally? Then it won't render-render after defined

@janrtvld janrtvld marked this pull request as ready for review November 21, 2024 12:11
@janrtvld
Copy link
Contributor Author

It will still re-render if anything in the state changes that that screen depends on.

I allowed both for now, that works?

@TimoGlastra TimoGlastra merged commit 0d0b739 into main Nov 21, 2024
1 check passed
@TimoGlastra TimoGlastra deleted the fix/pid-setup-fix branch November 21, 2024 12:19
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

Successfully merging this pull request may close these issues.

2 participants