Skip to content

Tags

#react

React components, hooks, state, rendering and performance, from first app to large production codebases.

13 posts

Posts tagged #react

  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

    Por que meu useEffect está rodando duas vezes? (e o fetch também)

    Boa noite, pessoal! Estou fazendo um projeto de portfólio (uma lista de filmes consumindo uma API pública) e notei uma coisa estranha: o console.log dentro do useEffect aparece duas vezes, e na aba Network o fetch também é feito duas vezes. useEffect(() => { console.log('buscando filmes') fetch('https://api.exemplo.com/filmes?pagina=' + pagina) .then(res => res.json()) .then(dados => setFilmes(dados.resultados)) },…

    Larissa Souza4likes6comments

  3. Experience

    AI tool generated our new component library. Then the accessibility audit came back with 143 issues

    회사 이름은 말 못 하지만... big portal company, React + TS. We had a deadline (always deadline) for new design system components. Management bought an AI tool that generates components from Figma, and the team was told: use it, ship faster. We shipped faster. 진짜 빨랐어요. 3 weeks instead of 8. Then the accessibility audit. 143 issues on the first 12 components. Some examples: Buttons were divs. <div onClick={...}> with no role,…

    박지우17likes9comments

  4. Question

    Error de TypeScript que no entiendo: Property 'nombre' does not exist on type 'never'

    Holaaa! Llevo una hora con esto y me da vergüenza preguntarle otra vez a mi tech lead jajaja. Tengo esto en un componente: const [usuarios, setUsuarios] = useState([]) useEffect(() => { fetch('/api/usuarios') .then(res => res.json()) .then(data => setUsuarios(data)) }, []) return ( <ul> {usuarios.map(u => <li key={u.id}>{u.nombre}</li>)} </ul> ) Y TypeScript me marca en rojo u.id y u.nombre : Property 'nombre' does…

    Lucía Ferrer7likes7comments

  5. 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

  6. 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

  7. Article

    useEffect no es para todo: 5 cosas que hacía mal y cómo las arreglé

    Parce, hace un año revisé un proyecto mío viejo y conté 43 useEffect. Hoy tiene 9. Y funciona mejor. Les cuento los 5 errores que más cometía, por si se ven reflejados. 1. Estado derivado en un efecto // mal const [nombreCompleto, setNombreCompleto] = useState('') useEffect(() => { setNombreCompleto(nombre + ' ' + apellido) }, [nombre, apellido]) // bien const nombreCompleto = nombre + ' ' + apellido Si algo se…

    Camilo Restrepo19likes9comments

  8. Article

    react + typescript interview questions from my last 11 rounds (and what they were actually testing)

    day 22 of the hunt. 11 rounds at 6 companies so far: 4 machine coding, 3 DSA (easy to medium), 2 frontend system design, 2 behavioural. here's what came up in the frontend rounds, and what i think each question was really testing. 1. "why does this effect run twice?" react 18 strict mode runs effects twice in development, on purpose, to catch effects that don't clean up after themselves. they are testing whether you…

    Sneha Kulkarni17likes10comments

  9. 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

  10. Article

    Web Dev Roadmap 2026 para sa beginners (libre lahat, walang bootcamp)

    Mga kapatid, ito na yung pinaka-hinihingi niyo sa comments ko for months. Yung roadmap na binibigay ko sa mga students ko, buo, libre. Hindi ito para maging "senior in 3 months". Ito ay para sa taong may trabaho o nag-aaral, may 2 oras kada araw, at gustong maging job-ready sa loob ng isang taon. (Goal desk. Hindi akin. Yung akin may electric fan at kapeng 3-in-1.) Phase 0: Setup (week 1) VS Code, Git, at isang…

    Kuya Migs27likes18comments

  11. Experience

    출근 전에 울었다. I cried before work, then shipped the launch

    오늘은 그냥 솔직하게 쓰고 싶어요. I want to write honestly today. Sorry for mixed language... Last week was launch week for big redesign at my company. Six weeks of crunch before. Every day office until 10 or 11 pm, Saturday also, sometimes Sunday "only for few hours". 야근, 주말 출근. Everyone does it, so nobody talks about it. On launch day morning, I sat on my bed with my bag and shoes on. And I could not stand up. Not sick. Just...…

    박지우9likes8comments

  12. Article

    satisfies, NoInfer and the design system that stopped lying to us

    Our design system has around 60 components, 4 brands, and one recurring bug class: a value that TypeScript said was fine and the UI said was not. Here are the three patterns that killed most of them. Nothing exotic, yani, but my team only believed me after seeing the errors. 1. Tokens: satisfies instead of an annotation We had this: const toneColors: Record<string, string> = { neutral: '#3f3f46', success: '#15803d',…

    Elif Korkmaz24likes9comments

Get the best of Dynamo Geeks weekly

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