Cory House(@housecor) 's Twitter Profileg
Cory House

@housecor

Consultant. Sharing coding tips. I help devs grow. Teaching software dev: https://t.co/D5emROQa4J Helping teams switch to React: https://t.co/Qfp4Tfp3jf ⚛️

ID:19268321

linkhttp://www.reactjsconsulting.com calendar_today21-01-2009 00:57:19

35,8K Tweets

116,6K Followers

714 Following

Follow People
Cory House(@housecor) 's Twitter Profile Photo

In the last 10 years I think the change that has most improved my web development experience is moving from JavaScript to TypeScript.

I haven't seen 'undefined is not not a function' in years.

I check the docs less often because autocomplete is fantastic.

I don't write imports…

account_circle
Cory House(@housecor) 's Twitter Profile Photo

Problem: I want to show a spinner if any React Query mutations are in progress.

Solution: useIsMutating. This hook returns true if any mutations are running.

Problem: I want to show multiple spinners, depending on which mutations are pending.

Solution: useMutationState. This…

account_circle
Cory House(@housecor) 's Twitter Profile Photo

Sometimes the divide between the backend and frontend leads to massive waste.

Example: I'm looking at a web page that displays 6 numbers. Sounds simple. But, here's how it gets the 6 numbers: It requests an array of 1.2MB (75,000+ lines!) of JSON. 🤯The client iterates over this…

account_circle
Cory House(@housecor) 's Twitter Profile Photo

Imagine being stuck with a substandard approach because React was overly opinionated.

Thankfully React didn't make that mistake.

React lets me pick the best tools in the ecosystem for my unique needs.

account_circle
🐙 React Rally 🤖(@ReactRally) 's Twitter Profile Photo

Not one, but TWO workshops offered at 🐙 React Rally 🤖

The one and only Cory House will be sharing an impressive 10 years of Advanced React with us!

Early bird tickets are live now, snag them before they are gone!

Not one, but TWO workshops offered at @ReactRally The one and only @housecor will be sharing an impressive 10 years of Advanced React with us! Early bird tickets are live now, snag them before they are gone!
account_circle
Cory House(@housecor) 's Twitter Profile Photo

Problem: Fetching in useEffect is clunky, verbose, and error prone.

Solution: Use one of these instead:

1. React Server Components
2. Tanstack Query
3. Tanstack Router loaders
4. React Router loaders
5. Remix loaders
6. RTK Query
7. Apollo
8. swr

account_circle
Cory House(@housecor) 's Twitter Profile Photo

Challenge: Name something that a software developer should *always* do.

Is there a single practice that always applies?

'Write tests'. Not always worth it.
'Do code reviews'. May pair instead.
'Set up a CI server'. Overkill when working alone.

I can only think of 2 practices…

account_circle
Cory House(@housecor) 's Twitter Profile Photo

These results blow my mind.

2,000+ responses and nearly 50% say you should *always* create a REST/GraphQL API in front of the DB.

Always?
No exceptions?

What if it’s a server-rendered app and it’s the only app using the DB? What does putting a REST/GraphQL API in front of…

These results blow my mind. 2,000+ responses and nearly 50% say you should *always* create a REST/GraphQL API in front of the DB. Always? No exceptions? What if it’s a server-rendered app and it’s the only app using the DB? What does putting a REST/GraphQL API in front of…
account_circle
Cory House(@housecor) 's Twitter Profile Photo

Poll: Do you believe every web app should have an API (REST/GraphQL/RPC) in front of the DB?

If always, why?
If it depends, upon what?

account_circle
Cory House(@housecor) 's Twitter Profile Photo

Early in my career, when someone would interrupt me while coding, it would stress me out.

I felt like I had a house of cards in my head. So it was hard for me to task switch, and it was hard for me to get back into flow.

I don't feel this sensation much anymore.

Here's why:…

account_circle
Cory House(@housecor) 's Twitter Profile Photo

Pattern: Break a big test into separate functions.

Benefits:
✅ Breaks a long test down into well-named pieces.

✅ The page under test can be loaded only once and tested in many ways. This can help speed up the test suite if the page is slow to load.

Downsides:
🚩 Monolithic.…

Pattern: Break a big test into separate functions. Benefits: ✅ Breaks a long test down into well-named pieces. ✅ The page under test can be loaded only once and tested in many ways. This can help speed up the test suite if the page is slow to load. Downsides: 🚩 Monolithic.…
account_circle