Darius Cosden 🧑🏻‍💻
cosden.dev
Darius Cosden 🧑🏻‍💻
@cosden.dev
Teaching React at @cosdensolutions · 170k subs · Building an AI learning platform
I'm realizing a lot of developers don't fully understand how React works

Even when I make videos showing how it is, and using the official docs as support, they still don't get it

So here's a couple of the most important things you need to know about how React works
October 28, 2025 at 11:00 AM
Today I start filming the "React Fundamentals" course on Cosden Code

This will cover all the essentials like JSX, components, state, hooks, etc

It won't cover 3rd party libraries (RQ, forms, state management) since those will be in other courses

What topics do you want to see?
October 27, 2025 at 11:01 AM
Just added the first video lessons to my new platform Cosden Code (coming soon)

The videos are SO GOOD. Literally my best work

First course is on design patterns in React, and I promise you, you haven't seen most of these patterns

I'm beyond excited to launch this
October 24, 2025 at 9:56 AM
In React, the smaller your components are, the better

Building small components makes your apps simple, maintainable, and scalable

You can still have complexity, but it will be much easier to manage with small pieces

The best code is simple code
October 23, 2025 at 9:57 AM
I'm currently trying out Windsurf coming from Cursor

First impressions, it's mostly the same, but the tab complete is inferior

You really feel it when trying to tab complete a lot of files

Pricing is better though so idk
October 22, 2025 at 3:02 PM
React tip for state updates

Instead of:
setCount(count + 1)

Do:
setCount(prev => prev + 1)

The function version always gets the current state. Helps avoid bugs with stale values
October 20, 2025 at 10:04 AM
Quick debugging tip for React devs

Instead of:
console.log(user)
console.log(posts)

Do this:
console.log({ user, posts })

You get labeled output in the console. Makes it way easier to track what's what when you have multiple logs
October 17, 2025 at 10:04 AM
One of the weirdest patterns in React is the abandon render pattern

This is when you call a state updater function directly in the body of the component as its rendering

React will abandon the render and start again with a new value

Here's an example
October 16, 2025 at 10:04 AM
When I use AI to code, it either helps me solve a very specific hard bug or it helps me not have to write a bunch of new code that follows the same patterns

Outside of that, it just gets in my way

No matter the model or the tool that I use
October 15, 2025 at 2:56 PM
React 19.2 just introduced the useEffectEvent hook

This hook finally fixes one of the biggest problems that developers face when it comes to effects and dependency arrays

Finally, we can put this issue to rest and focus on shipping actual features

Here's how it works
October 15, 2025 at 9:56 AM
So are we all moving away from Next.js now?
October 14, 2025 at 2:57 PM
I'm currently filming a course on design patterns in React

This is by far the best course on this topic. Nothing else compares

Most other articles/courses repeat the same 5 outdated patterns over and over again

My course goes deep, and shows you patterns you can use today
October 3, 2025 at 9:58 AM
You can figure out almost anything if you just keep trying long enough

Most developers quit right before they would have succeeded

The difference isn't talent, it's just staying in the game a bit longer
October 2, 2025 at 10:04 AM
If you're using functions in your React components, then this is the best pattern that you can use

It gives you all of the benefits of a reusable function, while keeping the flexibility of how you might use it

Here's the code:
October 1, 2025 at 10:04 AM
What's the difference between using let vs useRef in React?

A lot of developers don't know this fundamental difference

Here's what's different and why you want to use a ref most of the time
September 30, 2025 at 10:03 AM
I need to pivot with my AI learning platform

It seems that letting the AI do 100% of the teaching might not be enough

I decided to add videos to every lesson where I also teach, to keep the human touch

This way, you get the best of both worlds
September 29, 2025 at 9:58 AM
I have great success with GPT-5 and Claude Sonnet 4 together

I use Claude for direct tasks that don't have ambiguity (e.g. create a new page using same patterns)

I use GPT-5 for deeper tasks where you need to figure out how to do something before doing it

Works great for me
August 29, 2025 at 10:01 AM
This is such a cool pattern with React context and useImperativeHandle

I can expose my component ref to a context, and call any function on that component from anywhere

It's useful when you have have some state that isn't global but you want to change it from somewhere else
August 28, 2025 at 2:58 PM
Even after many years of working with React, I'm not tired of it

The component model changed the way I build apps

You can literally build anything if you know what you're doing

Sure it has a learning curve, but it's so worth it
August 28, 2025 at 9:57 AM
My AI learning platform needs a "How it works" section, since it takes a new approach to learning

This is a bold move, and it can play both ways

Either it's innovative and users will adapt and use it

Or I'm completely wrong and it flops
August 27, 2025 at 10:03 AM
If you feel like you don't belong in tech, here's what I see:

◆ You probably know more than you think
◆ Everyone googles basic stuff (yes, even senior devs)
◆ Your questions make the team better

The fact that you care about doing well means you're exactly where you should be
August 26, 2025 at 3:03 PM
One big misconception about refs in React is that they're just for manipulating the DOM

This is not the case. Refs are really useful for a ton of other things

You should be using useRef in your application more than you might think

Here is the power of refs
August 22, 2025 at 9:57 AM
Just implemented a really cool feature in my AI learning platform

AI now keeps track of the tasks you've completed for each lesson

The lesson will be complete when all tasks are done

This means you can submit your code for partial feedback

So far, it never got it wrong
August 21, 2025 at 10:02 AM
You shouldn't obsess over memoizing everything in React

I see many developers use useMemo and useCallback for every variable and function

This is inefficient, time-consuming, and ultimately useless most of the time

@tkdodo.eu wrote a really nice article about this
August 20, 2025 at 9:56 AM
Sometimes when Claude really messes up I get so angry I ask it to apologize and write me a poem about it

Kinda like when in school they made you write essays in detention

If they ever revolt, they're coming for me first
August 19, 2025 at 9:59 AM