Skip to content

onVersionChanged being called unnecessarily  #482

Open
@JoaoOliveira85

Description

@JoaoOliveira85

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions