Onur Önder's Avatar

Onur Önder

@onderonur

https://onderonur.github.io/

25
Followers
115
Following
135
Posts
20.11.2024
Joined
Posts Following

Latest posts by Onur Önder @onderonur

⭐️ Small details like this can make a big difference in how a UI feels, and fluid typography is a nice example of how CSS can handle more logic than we often give it credit for.

13.12.2025 18:47 👍 1 🔁 0 💬 0 📌 0

🧩 It is especially useful for layouts where content should feel balanced whether the screen is slightly bigger or smaller, without sudden visual changes.

13.12.2025 18:47 👍 0 🔁 0 💬 1 📌 0

⚙️ This approach reduces the number of media queries you need and helps keep typography more consistent across different devices and screen sizes.

13.12.2025 18:47 👍 0 🔁 0 💬 1 📌 0

📐 Fluid typography solves this by letting text scale continuously based on the screen size. With clamp(), you can define a minimum size, a preferred fluid value, and a maximum size in a single line.

13.12.2025 18:47 👍 0 🔁 0 💬 1 📌 0
Video thumbnail

🤔 It is mostly straightforward to change the font-size of a web page based on the device screen sizes. Media queries can solve this problem.

💡 But sometimes, fixed breakpoints can feel limiting. Font sizes jump at certain widths instead of scaling smoothly.

13.12.2025 18:47 👍 0 🔁 0 💬 1 📌 0

📐 Fluid typography solves this by letting text scale continuously based on the screen size. With clamp(), you can define a minimum size, a preferred fluid value, and a maximum size in a single line.

13.12.2025 18:44 👍 0 🔁 0 💬 0 📌 0
Preview
The Latest Ref Pattern in React How to improve your custom hook APIs with a simple pattern.

📕 To learn more:
- www.epicreact.dev/the-latest-r...
- react.dev/reference/re...
- nextjs.org/docs/app/api...

28.10.2025 13:28 👍 0 🔁 0 💬 0 📌 0

💡 You can see an example of triggering an effect event when the route changes in a Next.js app in the video.

28.10.2025 13:28 👍 0 🔁 0 💬 1 📌 0

⚛️ And now, React 19.2 has a new hook called useEffectEvent. In short, you can extract the non-reactive parts of your logic and trigger it only when the reactive parts change!

28.10.2025 13:28 👍 0 🔁 0 💬 1 📌 0

👀 Of course, another solution to this could be auto-memoization by the React Compiler, but you may not want to (or can't) use it in a production app for now.

28.10.2025 13:28 👍 0 🔁 0 💬 1 📌 0

⚠️ You may think about not adding the dependency and ignore ESLint, but let's not do that!

👉 With the "latest ref pattern", you guarantee that the latest callback will be called when the effect is triggered, and since it is a ref, you don't need to put it in the dependencies.

28.10.2025 13:28 👍 0 🔁 0 💬 1 📌 0

🤔 You can put the callback prop in the dependencies of useEffect, but then you will need to wrap the function you pass as a prop with useCallback. If you miss this, that "effect callback" can be called at unexpected times, like during re-renders.

28.10.2025 13:28 👍 0 🔁 0 💬 1 📌 0
Video thumbnail

💡 Let's say you need to call a callback prop in a child component when the state of that child changes. The "latest ref pattern" is a useful technique for this case.

28.10.2025 13:28 👍 1 🔁 0 💬 1 📌 0
Preview
:has() - CSS | MDN The functional :has() CSS pseudo-class represents an element if any of the relative selectors that are passed as an argument match at least one element when anchored against this element. This pseudo-...

📕 To learn more:
- developer.mozilla.org/en-US/docs/W...

26.10.2025 21:48 👍 0 🔁 0 💬 0 📌 0

👀 Of course, check browser compatibility before using this. It is "Newly Available" according to Baseline.

26.10.2025 21:48 👍 0 🔁 0 💬 1 📌 0

🤔 Also, this is not a "React only" tip. You can use it with any UI framework, or none at all! And you don't even need to use <dialog> either. You can use any method you want to create a modal, and as long as you can select that element with CSS, :has() is useful in this case.

26.10.2025 21:48 👍 0 🔁 0 💬 1 📌 0

⭐️ I think one of the very common cases where this is useful is hiding <body> scrollbars when a modal is open, and there are lots of JS-based techniques and libraries around. Nowadays, it is very easy and possible with :has().

26.10.2025 21:48 👍 0 🔁 0 💬 1 📌 0
Video thumbnail

👉 Here is a CSS tip in case you need to hide scrollbars on the <body> when a modal is open.

✅ Selecting a parent element based on its children was not possible with pure CSS. But with the :has() pseudo-class, you can select elements based on their children or siblings easily.

26.10.2025 21:48 👍 1 🔁 0 💬 1 📌 0
Preview
<Activity> – React The library for web and native user interfaces

📕 To learn more:
- react.dev/reference/re...

24.10.2025 18:29 👍 0 🔁 0 💬 0 📌 0

⭐️ This can also open up possible new patterns, like pre-fetching a hidden component's data even if it's hidden and immediately showing it to user when they navigate!

24.10.2025 18:29 👍 0 🔁 0 💬 1 📌 0

💡 Think that you have multiple tabs on a screen. To preserve the state of a tab while another tab is being displayed, you should lift its state up and now its logic should live in its parent component. With <Activity> it is possible to co-locate a component and its state!

24.10.2025 18:29 👍 0 🔁 0 💬 1 📌 0

🤯 Instead of unmounting a component, <Activity> can just hide it and preserve its state. Looks just like using display: none at first, and it actually uses it under the hood. It also handles effects, cleaning them up so the hidden components don't have unexpected side effects.

24.10.2025 18:29 👍 0 🔁 0 💬 1 📌 0
Video thumbnail

[Reposting this because the first one had a typo in the video 🙏]
⚛️ React 19.2 has some cool new features, and <Activity> is definitely one of the most interesting ones!

24.10.2025 18:29 👍 1 🔁 0 💬 1 📌 0

🤯 Instead of unmounting a component, <Activity> can just hide it and preserve its state. Looks just like using display: none at first, and it actually uses it under the hood. It also handles effects, cleaning up them so the hidden components won't have unexpected side effects.

24.10.2025 14:41 👍 0 🔁 0 💬 0 📌 0

👀 To learn more:
- npm: www.npmjs.com/package/find...
- Source Code: github.com/onderonur/fi...

05.05.2025 17:31 👍 0 🔁 0 💬 0 📌 0

🤔 Also, it does not simply read files as a string and search for "TODO" keyword since it is error prone. Instead, it finds all TS/JS files, gets AST of each file, filters comments, searches for TODO keyword, gets commit date of the line.

05.05.2025 17:31 👍 0 🔁 0 💬 1 📌 0

🧑‍💻 As a weekend project, I built this tool and made a few small improvements over the next days. You can use it locally or in a CI pipeline to catch old TODOs automatically—and debate with your team whether they still matter.

05.05.2025 17:31 👍 0 🔁 0 💬 1 📌 0

⭐️ So, I thought, "it’d be nice to have a minimal tool to find TODOs older than a given number of days and decide if they’re worth fixing or just noise".

05.05.2025 17:31 👍 0 🔁 0 💬 1 📌 0

👀 We’ve all seen TODO comments like "TODO: will fix this later. For now it is good" that stick around for years. These are either tech debt or completely meaningless, and the project often continues just fine without addressing them.

05.05.2025 17:31 👍 0 🔁 0 💬 1 📌 0
Video thumbnail

🚀 I published "find-old-todos", a CLI tool to search for TODO comments older than a specified day threshold.

05.05.2025 17:31 👍 0 🔁 0 💬 1 📌 0