mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 16:22:56 +02:00
CODEBASE: Add custom useRerender hook (#359)
This commit is contained in:
@@ -54,6 +54,7 @@ import { ProgramsSeen } from "../../Programs/ui/ProgramsRoot";
|
||||
import { InvitationsSeen } from "../../Faction/ui/FactionsRoot";
|
||||
import { hash } from "../../hash/hash";
|
||||
import { Locations } from "../../Locations/Locations";
|
||||
import { useRerender } from "../../ui/React/hooks";
|
||||
|
||||
const RotatedDoubleArrowIcon = React.forwardRef((props: { color: "primary" | "secondary" | "error" }, __ref) => (
|
||||
<DoubleArrowIcon color={props.color} style={{ transform: "rotate(-90deg)" }} />
|
||||
@@ -108,15 +109,7 @@ interface IProps {
|
||||
}
|
||||
|
||||
export function SidebarRoot(props: IProps): React.ReactElement {
|
||||
const setRerender = useState(false)[1];
|
||||
function rerender(): void {
|
||||
setRerender((old) => !old);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const id = setInterval(rerender, 200);
|
||||
return () => clearInterval(id);
|
||||
}, []);
|
||||
useRerender(200);
|
||||
|
||||
let flash: Page | null = null;
|
||||
switch (ITutorial.currStep) {
|
||||
|
||||
Reference in New Issue
Block a user