reduntant useEffect removed

This commit is contained in:
VividTruthKeeper 2022-08-20 00:43:38 +05:00
parent 2aa318cc01
commit 9075c2fa2f
8 changed files with 5 additions and 18 deletions

View File

@ -46,9 +46,6 @@ const AboutUs = () => {
useEffect(() => {
window.scrollTo(0, 0);
}, []);
useEffect(() => {
getAbout(setAbout);
getVideos(setVideo, () => null);
}, []);

View File

@ -12,6 +12,7 @@ const Contacts = () => {
useEffect(() => {
window.scrollTo(0, 0);
}, []);
return (
<main className="contact">
<div className="contact-bg">

View File

@ -34,13 +34,11 @@ const EventItem = () => {
],
content_html: "",
});
const { eventId } = useParams();
useEffect(() => {
window.scrollTo(0, 0);
}, []);
useEffect(() => {
setLoader(true);
getEvent(eventId, setEventData, setLoader);
}, [eventId]);

View File

@ -47,11 +47,9 @@ const Events = () => {
loaded: false,
});
useEffect(() => {
getAllPosts(setEvents);
}, []);
useEffect(() => {
window.scrollTo(0, 0);
getAllPosts(setEvents);
}, []);
const breakpoints = useMediaQuery("(max-width: 550px");

View File

@ -29,6 +29,7 @@ const PlayerProfile = () => {
const { playerId } = useParams();
useEffect(() => {
window.scrollTo(0, 0);
getPlayerInfo(setPlayerInfo, `${players}/${playerId}`);
}, [playerId]);

View File

@ -33,9 +33,6 @@ const Rating = () => {
]);
useEffect(() => {
window.scrollTo(0, 0);
}, []);
useEffect(() => {
getTeam(setPlayers);
}, []);

View File

@ -42,9 +42,6 @@ const Structure = () => {
useEffect(() => {
window.scrollTo(0, 0);
}, []);
useEffect(() => {
getStructure(setStructureData);
}, []);

View File

@ -48,11 +48,9 @@ const Tournaments = () => {
useEffect(() => {
window.scrollTo(0, 0);
}, []);
useEffect(() => {
getEvents(setTournaments);
}, []);
return (
<main className="tournaments">
<div className="tournaments-banner">