Skip to content

Commit

Permalink
observer-lazy-loading-package적용하기 (#175)
Browse files Browse the repository at this point in the history
* Chore: react-lazy-observer 패키지 설치

* feat: react-lazy-observer 패키지 대체
  • Loading branch information
KimKyuHoi authored Dec 5, 2024
1 parent 214a27e commit 7405c2d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 54 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"react-hot-toast": "^2.4.1",
"react-image-file-resizer": "^0.4.8",
"react-lazy-load-image-component": "^1.6.2",
"react-lazy-observer": "^1.2.0",
"react-loader-spinner": "^6.1.6",
"react-responsive": "^10.0.0",
"react-router-dom": "^6.28.0",
Expand Down
14 changes: 14 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 0 additions & 52 deletions src/components/common/View/LazyLoad.tsx

This file was deleted.

5 changes: 3 additions & 2 deletions src/pages/team/components/content/TeamContent.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import styled from '@emotion/styled';
import { useState, lazy } from 'react';
import { useMediaQuery } from 'react-responsive';
import { LazyLoad } from 'react-lazy-observer';

import { TeamList } from '@gdg/apis/hooks/team/useGetTeamList';
import LazyLoad from '@gdg/components/common/View/LazyLoad';
import {
TeamMember,
TeamCalendar,
TeamTitle,
TeamTitleMobile,
} from '@gdg/pages/team/components';
import { LoadingView } from '@gdg/components/common/View/LoadingView';
const TeamBlogList = lazy(() => import('../blog/TeamBlogList'));

const TeamContent = ({ data }: { data: TeamList[] }) => {
Expand Down Expand Up @@ -42,7 +43,7 @@ const TeamContent = ({ data }: { data: TeamList[] }) => {

<TeamCalendar selectedTeamName={selectedTeamName} />

<LazyLoad>
<LazyLoad fallback={<LoadingView />}>
<TeamBlogList selectedTeamName={selectedTeamName} />
</LazyLoad>
</TeamContainer>
Expand Down

0 comments on commit 7405c2d

Please sign in to comment.