mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 16:51:37 +00:00
Add memo to components
Add suspense for dynamic import
This commit is contained in:
@ -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);
|
Reference in New Issue
Block a user