useEffect -> useMemo
This commit is contained in:
parent
af28539a02
commit
bb7f795175
@ -1,4 +1,4 @@
|
|||||||
import { Dispatch, SetStateAction, useEffect, useState } from "react";
|
import { Dispatch, SetStateAction, useMemo, useState } from "react";
|
||||||
import { ReactSortable, ReactSortableProps } from "react-sortablejs";
|
import { ReactSortable, ReactSortableProps } from "react-sortablejs";
|
||||||
import api, { baseUrl } from "./api";
|
import api, { baseUrl } from "./api";
|
||||||
|
|
||||||
@ -304,7 +304,7 @@ export default function Rankings() {
|
|||||||
setPlayers(data as Player[]);
|
setPlayers(data as Player[]);
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useMemo(() => {
|
||||||
loadPlayers();
|
loadPlayers();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@ -314,21 +314,21 @@ export default function Rankings() {
|
|||||||
{user.length === 1 && (
|
{user.length === 1 && (
|
||||||
<>
|
<>
|
||||||
<div className="container navbar">
|
<div className="container navbar">
|
||||||
<button
|
<button
|
||||||
className="tablink"
|
className="tablink"
|
||||||
id="ChemistryButton"
|
id="ChemistryButton"
|
||||||
onClick={() => openPage("Chemistry", "aliceblue")}
|
onClick={() => openPage("Chemistry", "aliceblue")}
|
||||||
>
|
>
|
||||||
🧪 Chemistry
|
🧪 Chemistry
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
className="tablink"
|
className="tablink"
|
||||||
id="MVPButton"
|
id="MVPButton"
|
||||||
onClick={() => openPage("MVP", "aliceblue")}
|
onClick={() => openPage("MVP", "aliceblue")}
|
||||||
>
|
>
|
||||||
🏆 MVP
|
🏆 MVP
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="Chemistry" className="tabcontent">
|
<div id="Chemistry" className="tabcontent">
|
||||||
<Chemistry {...{ user, players }} />
|
<Chemistry {...{ user, players }} />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user