❓️ React is (becoming) Full-Stack

And battle of the Asyncs

Hey guys!

Today, we’ll take a look at why you should use React Query, how React is evolving into a full-stack framework, and some tips to optimize the performance of your apps.

Let's get into it! 🤙

What's your go to state management solution?

Login or Subscribe to participate in polls.

⚡️ The Latest In React

📦️ Open Source React Package for Generative AI
Hydra AI is an open-source React framework designed for creating generative UIs. Developers can register components, and the AI automatically selects, renders, and populates them with props like text and styles.

❓️Why React Query?
Data fetching is easy; managing that data over time is the real challenge. React Query excels here, acting more as an async state manager that’s tuned into server state needs. It doesn’t fetch data for you, you give it a promise (from fetch, Axios, GraphQL, etc.), and it handles the rest, making that data available across your app. This post dives into why React Query has gained such widespread popularity.

🛢️ Please Stop Using Barrel Files
File organization is a hotly debated topic among frontend developers, but most agree it’s better to adapt to an existing structure than have everyone do their own thing. A consistent, easy-to-understand codebase outweighs personal preferences. However, one thing to steer clear of? Barrel files.

⚔️ Battle of the Asyncs
This blog explores and compares React’s use and Solid’s createAsync primitives, focusing on how they handle async operations. Both turn promises into renderable values, but the differences in their implementation and feel are interesting.

🗣️ How to Interview your Interviewer
In tech interviews, candidates often feel scrutinized, but companies hold the real power, sometimes masking their true culture. It’s easy for them to present a polished front, so it's crucial for candidates to dig deeper. Remember, interviews are a two-way street, here’s how to interview your interviewer.

React is (becoming) a Full-Stack Framework

Robin Wieruch’s latest blog post is stirring up conversation in the React community. He argues that React, with the introduction of Server Components and Server Actions, is evolving into a true full-stack framework. React, once the go-to frontend library, has now extended its reach to backend functionalities, bridging the gap between the two.

Wieruch highlights two major breakthroughs: Server Components and Server Actions. Server Components execute React code on the server, allowing direct data source access (like databases) before returning the UI. Server Actions create HTTP API endpoints under the hood, enabling function execution as if they were remote procedure calls.

Together, these features push React into full-stack territory.

However, React itself only provides the basics. Meta frameworks built on top of React handle the complexity of bundling and interpreting directives between the client and server.

Over time, he argues as developers gain experience, they’ll master backend design patterns, ensuring we don’t end up with ORM function calls cluttering our React components. Exciting times lie ahead as the frontend transforms into a full-stack environment, and of course, check out the full blog post.

Optimizing Performance In React Applications

Vivek’s recent article on Tips for Faster React and Next.js Application Performance offers some good insights for optimizing your web apps. Performance is key, it can enhance user experience, boost SEO, and drive conversions. Here are some of the strategies he suggests:

  • Code Splitting 🗂️: Break down your app into smaller, load-on-demand chunks to reduce initial load times and enhance performance.

  • Lazy Loading ⏳: Delay loading non-essential resources until needed, significantly speeding up the initial load.

  • Efficient State Management 🧠: Proper state management prevents unnecessary re-renders, keeping large apps responsive.

  • Minimize Re-renders 🔄: Use React.memo, useMemo, and useCallback to avoid unnecessary re-renders and expensive recalculations.

  • Optimize Bundle Size 📦: Trim unused dependencies and analyze your bundle with tools like Webpack Bundle Analyzer to keep it lean.

  • Server-Side Rendering (SSR) 🖥️: Leverage SSR in Next.js to render pages on the server, sending fully rendered HTML to the client for faster load times.

The full article has code examples for each if you’d like to look deeper at any one point.

🚨 Video Alert

I recently uploaded a video where I dive into a super useful React technique: using URL query parameters as state.

This approach is a game-changer because it lets you keep your state even after a page refresh. Plus, you can easily share the state with others just by sending them the URL.

We’ll also be cleaning up a component with some refactoring while sticking to top-notch design patterns and React best practices.

You can watch it below.

See you next week!

Darius