refactor(Support): rewrite class component to functional#8173
refactor(Support): rewrite class component to functional#8173alexander-akait merged 5 commits intowebpack:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| <h2> | ||
| Backers | ||
| </h2> | ||
| `; |
There was a problem hiding this comment.
Can we add more tests and handle more cases, including, image not loaded and other stuff
…d missing rank/type cases
| } | ||
| } | ||
| return () => observer.disconnect(); | ||
| }, []); // eslint-disable-line react-hooks/exhaustive-deps |
There was a problem hiding this comment.
We need to rewrite it to do not have any eslint-disable-line, they are enabled to prevent errors/problems, here we have it
| ); | ||
| } | ||
| if (typeof age === "number") { | ||
| // eslint-disable-next-line react-hooks/purity |
There was a problem hiding this comment.
We still have eslint-disable-next-line react-hooks/purity, can you look at this, we should avoid any eslint problems
|
@sujalgoel Latest Sponsors is broken, no images, please check it and add test cases |
|
Looked into this. The Latest Sponsors filter keeps supporters whose Reproduced locally. With the JSON that ships in the latest preview build (Apr 22), no supporters fall in the window today. After running Same behavior as the previous class component, no regression from the refactor. Triggering a rebuild on the preview should populate the section. Added test coverage for the latest rank:
|
Summary
Part of #8161. Converts Support from a class component to a functional component using hooks. Moves the supporters computation into
useMemoto satisfy thereact-hooks/puritylint rule. Also adds tests.What kind of change does this PR introduce?
Refactor. No behavior or visual changes.
Did you add tests for your changes?
Does this PR introduce a breaking change?
No.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
N/A
Use of AI
No.