Skip to content

[codemod][FP/FN] react/19/remove-memoization #88

@SimonSimCity

Description

@SimonSimCity

Faulty codemod

react/19/remove-memoization

Sample code snippets

Original

  const templates = useMemo(() => {
    return templatesData.filter((template) =>
      isValidExtension(template.file_extension),
    );
  }, [templatesData]);

Expected

  const templates = templatesData.filter((template) =>
      isValidExtension(template.file_extension),
    );

Actual

  const templates = () => {
    return templatesData.filter((template) =>
      isValidExtension(template.file_extension),
    );
  };

Estimated impact

-/-

Logs:

-/-

Additional context

I think that a rewrite of this rule can be quite complicated, so it might be better not to raise false expectations and remove it. Having it in as is at least is bad, because it generates code that has a different type as it has had before.

In case there's anything more you need, please answer to this issue. I just wanted to provide you with as minimal out-of-context info as possible.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions