Why won't you just grab data from the fucking database

This commit is contained in:
Ray 2023-11-15 05:30:45 +00:00 committed by GitHub
parent 8215036e80
commit 97788eff86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -13,10 +13,14 @@ export function Detail(props) {
let { id } = useParams(); let { id } = useParams();
useEffect(() => { useEffect(() => {
if (!movieData) { if (!movieData && typeof props.handler === 'function') {
props.handler(id).then((movie) => setMovieData(movie)) const fetchMovieData = async () => {
const movieData = await props.handler(id);
setMovieData(movieData);
};
fetchMovieData();
} }
}, [id]); }, [id, movieData, props.handler]);
if (movieData) { if (movieData) {
return ( return (

View File

@ -46,6 +46,7 @@ export function Signup ( props ) {
} }
else { else {
setValidemail(false) setValidemail(false)
} }
}, [useremail]) }, [useremail])
@ -58,6 +59,8 @@ export function Signup ( props ) {
} }
}, [userpassword]) }, [userpassword])
return ( return (
<Container> <Container>
@ -103,4 +106,4 @@ export function Signup ( props ) {
</Row> </Row>
</Container> </Container>
) )
} }