Skip to content
This repository was archived by the owner on Oct 5, 2024. It is now read-only.
This repository was archived by the owner on Oct 5, 2024. It is now read-only.

Using useMemo instead of generic function #44

@Aztriltus

Description

@Aztriltus

For rendering the card content https://github.com/SouperOS/NftOS/blob/main/src/modules/UnstakedNFT/UnstakedNFT.tsx#L29, do you think it might be better to use the useMemo function instead?

I can see a few benefits of using useMemo here:

  • I think the component will not re-render unnecessarily if the dependencies (nfts, isLoading) are not different
  • When dependencies do change, we know what causes it to re-render by looking at the dependency array

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions