Add memo to components

Add suspense for dynamic import
This commit is contained in:
DefectingCat
2022-12-06 09:33:06 +08:00
parent 590e3d2752
commit 7954c974da
39 changed files with 455 additions and 382 deletions

View File

@ -1,5 +1,6 @@
import clsx from 'clsx';
import Button from 'components/RUA/Button';
import { memo } from 'react';
import { FiChevronUp } from 'react-icons/fi';
const BackToTop = () => {
@ -15,7 +16,7 @@ const BackToTop = () => {
<Button
onClick={handleBack}
className={clsx(
'!px-3 fixed',
'!p-3 fixed',
'right-4 bottom-4',
'lg:right-8 lg:bottom-8'
)}
@ -26,4 +27,4 @@ const BackToTop = () => {
);
};
export default BackToTop;
export default memo(BackToTop);