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();
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 (

View File

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