Skip to content

t/rerender-anonymous

Rerender Anonymous: top posts

The most useful posts in this topic, by likes from the community.

Posts

  1. Question

    please how do i fix my react timer, it stays at 1 😭

    good evening everyone 🙏🏾 i'm building a pomodoro timer for my portfolio. the seconds go from 0 to 1 and then it just stays at 1 forever. no error in the console. i just came across something called "stale closure" but i don't understand it. here is my code: import { useEffect, useState } from 'react' function Timer() { const [seconds, setSeconds] = useState(0) useEffect(() => { const id = setInterval(() => {…

    Damilola Ogunleye10likes7comments

  2. Question

    useEffect fetch running twice in my take-home test?? is my code broken

    doing a take-home for a junior role (round 2, we move 💪). simple React app that fetches a list of products. in the network tab i can see the request going out TWICE every time the page loads. i panicked and added a flag so it only fetches once, and now sometimes the list doesn't show at all, which is worse lol. here's the code: import { useEffect, useState } from 'react' let hasFetched = false export default…

    Jade Thompson9likes8comments

  3. Question

    why does my useEffect fetch run twice?? deps array is empty

    ok this is probably dumb but i have been staring at it for an hour. i have a component that fetches the users orders when it mounts. deps array is empty so it should only run once right?? but in the network tab i see TWO requests every time useEffect(() => { fetch('/api/orders') .then((res) => res.json()) .then((data) => setOrders(data)) }, []) i console logged inside it and yep, runs twice. react 18 with vite. is…

    Kevin Tran3likes3comments

  4. Question

    React form library for very long clinical forms (200+ fields), what holds up?

    A small team I advise is building an assessment form for nursing homes. It has more than 200 fields in about 15 sections, many conditional fields ("if a fall in the last 6 months, then ask..."), and it must save drafts, because nobody completes it in one sitting. They started with controlled inputs and one big state object, and typing became noticeably slow on the tablets the staff use. I am not a frontend…

    Hannah Weiss2likes3comments

Get the best of Dynamo Geeks weekly

One email each Monday with the most useful posts. No spam; unsubscribe in one click.