diff --git a/src/components/Home/RecentVideos.tsx b/src/components/Home/RecentVideos.tsx index c627d8b..80cbaa0 100644 --- a/src/components/Home/RecentVideos.tsx +++ b/src/components/Home/RecentVideos.tsx @@ -13,9 +13,10 @@ import { IVideoProps } from 'types/videos'; interface IRecentVideosProp { videos: IVideoProps[]; + searchRef: React.RefObject; } -const RecentVideos = ({ videos }: IRecentVideosProp) => { +const RecentVideos = ({ videos, searchRef }: IRecentVideosProp) => { return (
@@ -39,7 +40,12 @@ const RecentVideos = ({ videos }: IRecentVideosProp) => { window.scrollTo({ top: 0, behavior: 'smooth' })} > -

영상 정리해보기

+

searchRef.current?.focus()} + > + 영상 정리해보기 +

)} diff --git a/src/components/Home/SearchYoutube.tsx b/src/components/Home/SearchYoutube.tsx index f670393..679f7f6 100644 --- a/src/components/Home/SearchYoutube.tsx +++ b/src/components/Home/SearchYoutube.tsx @@ -137,7 +137,7 @@ const SearchYoutube = ({ searchRef }: Props) => { disabled={status === 'CONTINUE'} onChange={handleChangeInput} placeholder="https://youtube.com/..." - // searchRef={searchRef} + ref={searchRef} /> diff --git a/src/pages/HomePage.tsx b/src/pages/HomePage.tsx index bc1fa74..7feffd7 100644 --- a/src/pages/HomePage.tsx +++ b/src/pages/HomePage.tsx @@ -34,8 +34,8 @@ const HomePage: React.FC = () => { const isOpenModal = useRecoilValue(recommendationModalState); const [recentVideos, setRecentVideos] = useState([]); const [dummyVideos, setDummyVideos] = useState([]); - const searchRef = useRef(); const { createToast } = useCreateToast(); + const searchRef = useRef(null); const onFileClick = async ( videoId: number, @@ -84,7 +84,7 @@ const HomePage: React.FC = () => { backgroundColor: 'white', }} > - +