1
0
Fork 0
mirror of https://git.sr.ht/~ashkeel/strimertul synced 2024-09-18 01:50:50 +00:00

Make some functional components pure

This commit is contained in:
Ash Keel 2021-09-16 17:10:46 +02:00
parent 3cb61a8681
commit 7c5d3f449d
No known key found for this signature in database
GPG key ID: BAD8D93E7314ED3E
3 changed files with 9 additions and 3 deletions

View file

@ -14,7 +14,7 @@ export interface ModalProps {
bgDismiss?: boolean;
}
export default function Modal({
function Modal({
active,
title,
onClose,
@ -67,3 +67,5 @@ export default function Modal({
</div>
);
}
export default React.memo(Modal);

View file

@ -9,7 +9,7 @@ export interface PageListProps {
onPageChange: (page: number) => void;
}
export default function PageList({
function PageList({
current,
max,
min,
@ -116,3 +116,5 @@ export default function PageList({
</nav>
);
}
export default React.memo(PageList);

View file

@ -10,7 +10,7 @@ export interface TabbedViewProps {
tabs: TabItem[];
}
export default function TabbedView({
function TabbedView({
tabs,
children,
}: React.PropsWithChildren<TabbedViewProps>): React.ReactElement {
@ -36,3 +36,5 @@ export default function TabbedView({
</>
);
}
export default React.memo(TabbedView);