Skip to content

Respect "use no memo" - exclude components and hooks from the report #73

@kachkaev

Description

@kachkaev

I added "use no memo" in a couple of places where I do unconventional tricks with hook deps. Example:

export function useMyCustomHook(
  firstArgument: FirstArgument,
  deps: React.DependencyList,
): void {
  "use no memo";
  
  React.useEffect(() => {
    // logic around firstArgument
  }, [
    callback,
    // eslint-disable-next-line react-hooks/exhaustive-deps -- ...deps are added by design
    ...deps,
  ]);
}

This hook cannot be memoised by design so I annotate it with "use no memo". The extension still marks my custom hook with 🚫 and lists it in the report amongst 🚫 failed cases. It'd be great to treat disabled memorisation differently. WDYT?

Possibly related: #67

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions