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

onVersionChanged being called unnecessarily #482

Open
JoaoOliveira85 opened this issue Oct 23, 2024 · 1 comment
Open

onVersionChanged being called unnecessarily #482

JoaoOliveira85 opened this issue Oct 23, 2024 · 1 comment
Labels
Bug Something isn't working

Comments

@JoaoOliveira85
Copy link

Installer Version

3.4.1

Describe the bug

On the Modal component onVersionChanged() function seems to be unnecessarily called once every render. This issue was flagged in a comment a while ago: #458

Expected behavior

I assume this function should be called only once when the application is updated.

Steps to reproduce

Just launch the installer. To make it easier to see we can add a console.log() within the onVersionChanged function declaration. Whenever the application component renders this function gets called.

References (optional)

image

Additional info (optional)

This seems to happen because the function is being called directly in the render method. We could use a useEffect to make sure the function only gets called when necessary and we could also use a useCallback hook to prevent the function from being redeclared unnecessarily as well.

Discord Username (optional)

broax5707

@JoaoOliveira85 JoaoOliveira85 added the Bug Something isn't working label Oct 23, 2024
@JoaoOliveira85
Copy link
Author

I'd like to tackle this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant