βοΈ Day 38 #100DaysOfCode Infinite Scroll Part 1
One of the hardest parts of solving a problem is not getting overwhelmed by all the subproblems I havenβt solved yet.
So today I focused on an MVP:
set up the state
wire the async fetch
render the items
Scroll detection is next. πͺ
12.12.2025 18:38 β
π 3
π 0
π¬ 0
π 0
βοΈ Day 37 #100DaysOfCode Optimistic UI
At a high level:
Optimistic UI = let the frontend lead.
Update the UI immediately, then ask the server for confirmation.
If the server says βnoβ, roll back.
Trust user intent, let the UI move first, and clean up if the server disagrees.
02.12.2025 02:28 β
π 6
π 0
π¬ 0
π 0
βοΈ Day 36 #100DaysOfCode #React Suspense
Suspense is Reactβs built-in way to pause rendering when something isnβt ready and automatically show a fallback UI.
Why use it?
π Cleaner code
π Works with lazy components, streaming, and data fetching
π Makes async boundaries explicit and reliable
19.11.2025 00:29 β
π 4
π 0
π¬ 0
π 0
βοΈ Day 35 #100DaysOfCode #React Error Boundaries
If you want a shared fallback UI for API failures, you need to surface the error back into the render phase.
Pattern:
1οΈβ£ catch async error
2οΈβ£ store it in state
3οΈβ£ throw it during render β ErrorBoundary can now catch it
16.11.2025 03:18 β
π 6
π 0
π¬ 0
π 0
βοΈ Day 34 #100DaysOfCode #React has 2 phases
1οΈβ£ Render Phase = calculate UI
React runs your component + pure hooks
Builds + diffs the virtual DOM
β No DOM, no effects
2οΈβ£ Commit Phase = apply UI
React updates the DOM, then runs:
β‘οΈ useLayoutEffect (before paint)
β‘οΈ useEffect (after paint)
#frontend
13.11.2025 05:58 β
π 5
π 0
π¬ 0
π 0
βοΈ Day 33 #100DaysOfCode #React useLayoutEffect
Reactβs render cycle π
useLayoutEffect β paint βuseEffect
π§ useEffect:
Non-visual side effects, things the user won't see: data, timers, logging
π¨ useLayoutEffect:
Visual sync, things that affect whatβs painted: size, position, layout
12.11.2025 02:31 β
π 10
π 0
π¬ 0
π 0
βοΈ Day 32 #100DaysOfCode #React useDebounce
Typing triggers onChange instantly β‘οΈ
But you donβt always want instant reactions, like spamming an API with every keystroke.
π‘ Debounce = βwait until the user stops doing something.β
π’ useDebounce slows down chaos β creates calm
#frontenddevelopers
08.11.2025 01:33 β
π 4
π 0
π¬ 0
π 0
βοΈ Day 31 #100DaysOfCode #React useState vs derive data
π‘ Rule of thumb
β
can be recalculated from props or other state β derive it
βοΈ depends on user input or async data β store it
π§ βIf you can derive it, donβt store it.β
#frontenddevelopers
07.11.2025 01:03 β
π 7
π 0
π¬ 0
π 0
Cool, so each slice has its own actions to manage state changes, and the reducer just combines them back into the store?
07.11.2025 00:53 β
π 1
π 0
π¬ 1
π 0
how are slices used in your app?
06.11.2025 03:01 β
π 1
π 0
π¬ 1
π 0
that's way more fun than a rubber duck :3
06.11.2025 03:00 β
π 1
π 0
π¬ 1
π 0
Day 30 #100DaysOfCode #React.memo
React.memo tells React:
βIf the props didnβt change, skip re-rendering this component.β
When the parent re-renders
π§ React checks: did props change?
β
If no β reuse the last rendered output
β If yes β re-render normally
watch demo with π
#frontend
06.11.2025 02:49 β
π 6
π 0
π¬ 0
π 0
βοΈ Day 29 #100DaysOfCode #React useMemo?
useMemo stops unnecessary recalculations when inputs havenβt changed
β
Caches the last computed value
β
Reuses it if deps stay the same
β
Prevents re-creating arrays/objects that trigger re-renders
Watch the demo π with sound on π
#frontend
05.11.2025 01:47 β
π 7
π 0
π¬ 0
π 0
βοΈ Day 28 #100DaysOfCode #React usePrevious
React re-renders, use π§ usePrevious to remember the last renderβs value
β
Stores the last committed value
β
Doesnβt cause extra renders
β
Built on useRef + useEffect timing (runs after paint)
π‘React values are snapshots per render
#frontend #usePrevious
04.11.2025 01:42 β
π 5
π 0
π¬ 0
π 0
Which one of the usePrevious hook solutions is the idiomatic solution?
Approach 1: useState
Approach 2: useRef
#React #greatfrontend #usePrevious
04.11.2025 01:21 β
π 1
π 0
π¬ 0
π 0
βοΈ Day 27 #100DaysOfCode #React useReducer
When your state logic starts branching, use useReducer β keeps updates centralized & predictable:
β
Puts all state transitions in one place
β
Easier to test & debug centralized
β
Pairs great with Context
#FrontendDev
03.11.2025 00:42 β
π 5
π 0
π¬ 0
π 0
what are you working on? love to see what you're building
01.11.2025 02:30 β
π 1
π 0
π¬ 0
π 0
βοΈ Day 26 #100DaysOfCode forms in #React:
1β£Controlled = value in state β predictable UI, validation, derived rules
2β£Uncontrolled = DOM owns value (via ref) β minimal rerenders, large forms/3rd-party
πRule of thumb: default to controlled; use uncontrolled when only read on submit or need perf
01.11.2025 02:21 β
π 3
π 0
π¬ 0
π 0
Entrepreneurs Challenge π Cofounder Application
Current application demo: https://x.com/linzhangcs/status/1982898774851891608 Once accepted, the Entrepreneurs Challenge program provides how-to workshops, hands-on boot camps, 1:1 coachingβall design...
@buildinginpublic.bsky.social
Looking for a cofounder for $75,000 funding! π
apply hereπ forms.gle/hFLpb5mTMtf1...
Building an adaptive productivity app, DM if you want to know more
Iβm product + frontend (Next.js/React/AI)
You: biz ops, community building, or backend/AI mind πΏ
31.10.2025 19:17 β
π 2
π 0
π¬ 0
π 0
nice layout
30.10.2025 23:52 β
π 0
π 0
π¬ 0
π 0
βοΈ Day 25 #100DaysOfCode React State Debug
You console.log state right after setState inside your handler to see the change, and it's still the old value? π€
β
ways to confirm the update:
π Show it directly in the UI
π Log it inside a useEffect that depends on that state
#React #frontend
30.10.2025 21:58 β
π 3
π 0
π¬ 0
π 0
Just saw this, I guess you like EmberJS? I have not used it. I will check it out.
30.10.2025 21:15 β
π 2
π 0
π¬ 1
π 0
It's good that you have a clear preference. I don't know if I like React. It has the largest support system, that is all.
What's your favorite frontend library/framework?
30.10.2025 21:06 β
π 0
π 0
π¬ 0
π 0
Day 24 #100DaysOfCode #React Batching
React doesnβt update state right away
π§© It batches multiple updatesβ runs one render β one DOM commit
setState feels delayed because React:
πDefers updates until the current function exits
πAvoids extra re-renders
πUpdates the DOM after reconciling all changes
29.10.2025 22:08 β
π 5
π 0
π¬ 0
π 0
Thatβs where React really shines. It takes care of the messy DOM updates for you and keeps the UI declaratively tied to your data, so you can focus on what the UI should look like, not how to update it every time something changes.
29.10.2025 21:44 β
π 0
π 0
π¬ 1
π 0
Youβre right that JavaScript already gives you solid tools for managing data and behavior.
The tricky part, especially as apps got bigger, wasnβt managing the state itself. It was keeping the UI in sync with that state. DOM API doesn't have a built-in way to automatically reflect those state changes
29.10.2025 21:44 β
π 0
π 0
π¬ 1
π 0
Day 23 #100DaysOfCode Why React rerenders π§
React rerenders when reactive data changes:
state or props.
Too many re-renders? β‘
Issue with non-UI data in useState.
πΉ Use useState for UI: state and props
πΉ Use useRef for internal tracking: timers, previous values, or DOM refs
#react #frontend
29.10.2025 01:25 β
π 7
π 0
π¬ 1
π 0
Day 22 #100DaysOfCode React useState vs useRef
In React, the real mental unlock is this:
π§© Reactive data vs Non-reactive data
useState β triggers re-render when changed
useRef β persists data, but React doesnβt care
codesandbox.io/p/sandbox/4y...
#frontend #react
28.10.2025 01:48 β
π 4
π 0
π¬ 0
π 0
Wow, that's amazing. Keep us updated!
27.10.2025 19:44 β
π 1
π 0
π¬ 0
π 0
Iβm learning JavaScript because I want to become an engineer and build my own products. Itβs not easy! Iβve been learning and using it for the past 7β8 years, and it takes time!
27.10.2025 19:43 β
π 0
π 0
π¬ 0
π 0