1
0
Fork 0
mirror of https://git.sr.ht/~ashkeel/strimertul synced 2024-09-20 02:00:49 +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; bgDismiss?: boolean;
} }
export default function Modal({ function Modal({
active, active,
title, title,
onClose, onClose,
@ -67,3 +67,5 @@ export default function Modal({
</div> </div>
); );
} }
export default React.memo(Modal);

View file

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

View file

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