diff --git a/src/pages/Detail.js b/src/pages/Detail.js index 9535139..410e8fe 100644 --- a/src/pages/Detail.js +++ b/src/pages/Detail.js @@ -13,10 +13,14 @@ export function Detail(props) { let { id } = useParams(); useEffect(() => { - if (!movieData) { - props.handler(id).then((movie) => setMovieData(movie)) + if (!movieData && typeof props.handler === 'function') { + const fetchMovieData = async () => { + const movieData = await props.handler(id); + setMovieData(movieData); + }; + fetchMovieData(); } - }, [id]); + }, [id, movieData, props.handler]); if (movieData) { return ( diff --git a/src/pages/Signup.js b/src/pages/Signup.js index 256fe97..1e159c4 100644 --- a/src/pages/Signup.js +++ b/src/pages/Signup.js @@ -46,6 +46,7 @@ export function Signup ( props ) { } else { setValidemail(false) + } }, [useremail]) @@ -58,6 +59,8 @@ export function Signup ( props ) { } }, [userpassword]) + + return ( @@ -103,4 +106,4 @@ export function Signup ( props ) { ) - } + } \ No newline at end of file