This Week In React #176: React Compiler, TanStack, Vinxi, Remix i18n, Next.js security, Shopify RN perf, Uni Stack...
Tags: react, reactnative
Published: 2024-03-09 11:26:31

---
series: This Week In React
canonical_url: https://thisweekinreact.com/newsletter/176
---

Hi everyone!

This week is difficult to sum up, there's a lot of interesting news and I don't know which to highlight.

We notably have a sneak peek of a new React core hook replacing the confusing `useFormState`, that even React Native devs will now be able to use now!

---

💡 Subscribe to the [official newsletter](https://thisweekinreact.com?utm_source=dev_crosspost) to receive an email every week!

[![banner](https://thisweekinreact.com/img/TWIR_POST.png)](https://thisweekinreact.com?utm_source=dev_crosspost)

---

## 💸 Sponsor

[![Axiom - the best logging platform for Vercel apps](https://thisweekinreact.com/emails/issues/171/axiom.jpg)](https://axiom.co/vercel)

**[Axiom - the best logging platform for Vercel apps](https://axiom.co/vercel)**

😴 Sleep peacefully knowing that Axiom’s zero-config observability for Vercel projects has you covered.

- Use Axiom's pre-built dashboard for an overview across all your Vercel logs and vitals, drill down to specific projects and deployments, and get insight on how functions are performing with a single click.
- [next-axiom](https://github.com/axiomhq/next-axiom) allows you to send logs and events from any part of your Next.js projects - client, edge, or server-side - without any special configuration.
- Easily send structured logs directly from your code and analyze them together with Vercel logs.

Axiom efficiently captures 100% of your event data so you’ll never have to worry about sampling or retention, and you’ll never have to guess what your users are experiencing.

**PS**: [I use it myself to monitor the newsletter signups](https://twitter.com/sebastienlorber/status/1528666563452317696) 😉

---

## ⚛️ React

[![React Core PR - New useActionState hook](https://thisweekinreact.com/emails/issues/176/useActionState.jpg)](https://github.com/facebook/react/pull/28491)

**[React Core PR - New useActionState hook](https://github.com/facebook/react/pull/28491)**

It turns out the useFormState hook was confusing, and not even meant to be solely used in forms. The React team is addressing this by introducing a new React core hook to replace it:

- Renames `useFormState` to `useActionState`
- Adds a pending state to the returned tuple
- Moves the hook to the `react` package

Moving it from `react-dom` to `react` also means that now, other renderers such as React Native can use it too. There are other benefits to look at, such as a “partial progressive enhancement” feature, but also new caveats documented in the PR.

---

- 💸 [Secure your documents with PDF Redaction. Discover how to protect sensitive information in PDFs using React. Visit our blog to learn more.](https://apryse.com/blog/pdf-redaction-using-react?utm_source=this%20week%20in%20react&utm_medium=newsletter3)
- 🐦 [React 19 != React Compiler](https://twitter.com/sebastienlorber/status/1764950877620654474): The React Labs post is a bit ambiguous and misled many of us, so let’s clarify. The compiler will likely come after the React 19.0 release as a separate project, and there’s a good chance it will initially be released as a Babel/TypeScript plugin. The internals are decoupled through, so it shouldn’t take long to adapt it it to Rust.
- 🐦 [TanStack Start preview](https://twitter.com/tannerlinsley/status/1765120904370307438): Tanner works on a TanStack Start full-stack framework based on Vinxi and TanStack Router. This preview shows he’s migrating his own TanStack site to it.
- 📜 [Vercel - Introducing AI SDK 3.0 with Generative UI support](https://vercel.com/blog/ai-sdk-3-generative-ui): With the AI SDK 3.0 and thanks to React Server Components, you can now stream UI components directly from LLMs. Super impressive demos!
- 📜 [Secure statically rendered paid content in Next.js (with the App Router)](https://www.ericburel.tech/blog/static-paid-content-app-router): Shows that using Next.js layouts for authentication is not super secure, and the protected content can still leak through the RSC endpoint. Suggests using a middleware instead.
- 📜 [Internationalization with Remix](https://remix.run/blog/remix-i18n): Goes back to i18n fundamentals, and then detail various i18n solutions you can set up within Remix. Optional route segments can help you use localized sub-directories.
- 📜 [Did you know you can write your own typesafe React router in 500 lines?](https://sinja.io/blog/build-typesafe-react-router-from-scratch): A great comprehensive article that might give you a better understanding of how existing routers work. Also great to learn about advanced TypeScript type-level programming techniques.
- 📜 [Streaming HTML out of order without JavaScript](https://lamplightdev.com/blog/2024/01/10/streaming-html-out-of-order-without-javascript/): This super interesting demo shows we don’t need JavaScript to stream out-of-order HTML chunks, and yet render them in the correct order. All you need is Declarative Shadow DOM and slots. It will be interesting to see if RSC streaming + Suspense could leverage that technique in the future instead of inlining JavaScript.
- 📜 [Simple RSC With Vinxi](https://www.brenelz.com/posts/simple-rsc-with-vinxi/): The Vinxi SDK helps you create your own full-stack framework, and it even has a plugin for React Server Components support!
- 📜 [Million.js - Blocks with noSlot Mode](https://million.dev/blog/block-noSlot): the Million compiler might wrap your components with `<slot>` elements, which might cause issues (styling). This introduces a new experimental `noSlot` mode..
- 📜 [How to add Monaco to a Next.js app to enable custom user workflows](https://deno.com/blog/monaco-nextjs): Interesting tutorial that also shows how to deploy untrusted user code to Deno.
- 📜 [Conceptual Model of React and RSC](https://ondrejvelisek.github.io/conceptual-model-of-react-and-rsc/): Reflects around the UI=f(state) formula in interesting ways, and concludes RSC kind of breaks the original model.
- 📜 [Why React Server Components Are Breaking Builds to Win Tomorrow](https://www.builder.io/blog/why-react-server-components)
- 📜 [The End Of My Gatsby Journey](https://www.smashingmagazine.com/2024/03/end-of-gatsby-journey/)
- 📜 [React Admin March 2024 Update](https://marmelab.com/blog/2024/03/05/react-admin-march-2024-update.html)
- 📦 [Million Lint - public beta](https://million.dev/blog/lint): A VSCode extension that helps you keep your React code fast thanks to dynamic analysis. Much simpler to use than React Devtools flame graphs. There will be an additional AI-based Lint++ paid service built on top to suggest you possible performance improvements.
- 📦 [react-unforget - A compiler for automatic optimization of React apps](https://github.com/mohebifar/react-unforget): After Forgetti, this is another new alternative React compiler coming from the community. See also 🐦 [Joe Savona’s feedback](https://twitter.com/en_JS/status/1763593971224494106).
- 📦 [Remix 2.8 - Pass resolved viteConfig to buildEnd hook](https://remix.run/docs/en/main/start/changelog#v280)
- 📦 [React Query 5.25 - skipToken, typesafe query disabling](https://github.com/TanStack/query/releases/tag/v5.25.0)
- 📦 [TanStack Router 1.18 - route groups](https://github.com/TanStack/router/releases/tag/v1.18.0)
- 📦 [Starlight 0.21 - New UI components: Steps, FileTree](https://starlight.astro.build/guides/components/)
- 📦 [Storybook 8.0 RC - v8 is officially stable enough to be used in production](https://github.com/storybookjs/storybook/releases/tag/v8.0.0-rc.0)
- 📦 [Onborda - Onboarding wizard flow for Next.js powered by Framer Motion](https://github.com/uixmat/onborda)
- 📦 [Input-OTP - One-time password input component for React](https://input-otp.rodz.dev/)
- 📦 [Panda 0.33](https://github.com/chakra-ui/panda/discussions/2274)
- 📦 [UVCanvas - React component library for beautifully shaded canvas](https://uvcanvas.com)
- 🎥 [Jack Herrington - Is Tanstack Router Better Than React-Router?](https://www.youtube.com/watch?v=qOwnQJOClrw)
- 🎥 [Theo - How Shadcn/ui Actually Works](https://www.youtube.com/watch?v=AqmMx_JidGo)

---

## 💸 Sponsor

[![Need more than just a sign-in box?](https://thisweekinreact.com/emails/issues/176/clerk.jpg)](https://clerk.com/?utm_source=thisweekinreact&utm_medium=newsletter&utm_campaign=middleware&utm_content=03-06-24)

**[Need more than just a sign-in box?](https://clerk.com/?utm_source=thisweekinreact&utm_medium=newsletter&utm_campaign=middleware&utm_content=03-06-24)**

Clerk streamlines React app authentication and user management, ensuring a quick setup for the modern web.

Experience the benefits of Clerk:

- 💅 Pre-built UI components for sign-in, sign-up, user profiles, and organizations. Customize with any CSS library and deploy on your domain
- 📦 SDKs for React, React Native, Next.js, Redwood, Remix, and other frameworks
- ⚡ Integrations with Firebase, Supabase, Convex, and other BaaS providers
- 🎁 User management, social login, magic links, MFA, and more out of the box

Dive into Clerk's [quickstarts and tutorials](https://clerk.com/docs/quickstarts/overview?utm_source=sponsorship&utm_medium=newsletter&utm_campaign=thisweekinreact&utm_term=02-28-24) to kickstart your project🚀

---

## 📱 React-Native

This section is now co-authored with [Benedikt](https://twitter.com/bndkt). Feel free to send us your comments by email or on [Twitter](https://twitter.com/bndkt)!

[![Improving Shopify App’s Performance](https://thisweekinreact.com/emails/issues/176/shopify.jpg)](https://shopify.engineering/improving-shopify-app-s-performance)

**[Improving Shopify App’s Performance](https://shopify.engineering/improving-shopify-app-s-performance)**

Shopify has been a proponent of React Native for a long time. But they did notice their app performance go down since they migrated to React Native. Instead of blaming the tech stack, they got to work and started optimizing for performance. The results speak for themselves: App launch is 44 % faster and screen load times were reduced by 59 %. Here’s a quick summary of some of the measures they took (hint: FlashList plays a big role in some of these). For details, read their great summary post:

- Initially, only render what’s visible on the screen (especially true for the home screen)
- Build all screens as lists (based on FlashList)
- Use inlineRequires
- Batch state changes
- Optimize caching

Very interesting insights and impressive results. I hope the Shopify team keeps sharing these details and maybe we’ll even see some of the things they mentioned they built during this process ending up as Open Source?

---

- 💸 [React Universe Conf combines the best of React Native EU with a new enhanced program. Get your ticket at the lowest price before March 7](https://www.reactuniverseconf.com/?utm_campaign=React_Universe_Conf&utm_source=email&utm_content=This_Week_in_React)
- 👀 [PR - RCTRootViewFactory](https://github.com/facebook/react-native/pull/42263): Simplifies brownfield integrations on iOS and spares you from worrying about Old Arch/New Arch/Bridge/Bridgeless combinations.
- 🐦 [Drag and drop files from other apps in your RN app](https://x.com/alihdjr/status/1764393524940673529)
- 📖 [visionOS docs - Integrating in existing projects](https://callstack.github.io/react-native-visionos-docs/docs/guides/integrate-into-existing-projects/)
- 📜 [Expo - Orchestrate advanced workflows with custom builds](https://expo.dev/blog/orchestrate-advanced-workflows-with-custom-builds): Custom builds allow you to run scripts (bash or JS) before or after Expo builds, for example to run E2E tests, send notifications to your team, …
- 📜 [iOS Live Activities and React Native - leveraging the latest iOS features to display your app's most current data without needing to open it](https://www.reactnative.university/blog/live-activities-unleashed): Way more apps should have Live Activities! There is a hurdle for RN devs though, because they need to be written in Swift. This 3-part series walks through all the steps required to add a Live Activity.
- 📜 [React Native Error Boundaries - Feature, Partial, and Server](https://www.reactnative.university/blog/react-native-error-boundaries): Error boundaries remain an underutilized feature, and every React Native app should have at least one (but ideally more). This post explains why and how.
- 📜 [Increase Speed and Security With Native Crypto Libraries](https://www.callstack.com/blog/increase-speed-and-security-with-native-crypto-libraries)
- 📜 [Morrow's Summary of the State of React Native 2023 Report](https://www.themorrow.digital/blog/our-summary-of-the-state-of-react-native-2023-report)
- 📦 [Intercom-react-native 6.5 - Now with Expo config plugin](https://github.com/intercom/intercom-react-native/releases/tag/6.5.0)
- 📦 [Uni Stack - React Native starter w/ Expo, Prisma, tRPC](https://www.uni-stack.dev/)
- 📦 [Expo-foreground-actions - Start actions that continue to run in the grace period after the user switches apps](https://github.com/Acetyld/expo-foreground-actions)
- 📦 [React Native 0.74.0 RC 2](https://github.com/facebook/react-native/releases/tag/v0.74.0-rc.2)
- 🎙️ [RNR 290 - The State of React Native survey with Bartłomiej Bukowski](https://reactnativeradio.com/episodes/the-state-of-react-native-survey-with-bartomiej-bukowski)
- 🎙️ [Rocket Ship 32 - From broke Teacher to Software Engineer with Zach Taylor](https://podcast.galaxies.dev/episodes/032-from-broke-teacher-to-software-engineer-with-zach-taylor)
- 🎥 [Simon Grimm - uild a Kids Drawing App with React Native](https://www.youtube.com/watch?v=G5TjXRHoEno)
- 🎥 [notJust Dev - Build Your Own Blog with React Native (for Web & Mobile)](https://www.youtube.com/watch?v=ewW6_baBXko)
- 📅 [Chain React Call for Speakers now open until May 3, 2024](https://sessionize.com/chain-react-2024/)
- 📅 [React Universe Conf 2024 - Early bird ends today](https://ti.to/RUC/react-universe-conf-2024)

---

## 🔀 Other

- 💬 [TypeScript 5.5 Iteration Plan - new Set methods, config extension merging](https://github.com/microsoft/TypeScript/issues/57475)
- 📜 [Effective TypeScript - The Hidden Side of Type Predicates](https://effectivetypescript.com/2024/02/27/type-guards/)
- 📜 [Deno - Introducing JSR - the JavaScript Registry](https://deno.com/blog/jsr_open_beta)
- 📜 [OpenJS Launches New Collaboration to Improve Interoperability of JavaScript Package Metadata](https://socket.dev/blog/openjs-improve-interoperability-of-javascript-package-metadata)
- 📜 [Open Web Advocacy - Apple backs off killing web apps, but the fight continues](https://open-web-advocacy.org/blog/apple-backs-off-killing-web-apps/)
- 📜 [Top 8 Recent V8 in Node Updates](https://blog.appsignal.com/2024/02/28/top-8-recent-v8-in-node-updates.html)
- 📦 [WebKit Features in Safari 17.44 - CSS @scope, align-content](https://webkit.org/blog/15063/webkit-features-in-safari-17-4/)
- 📦 [Shiki-magic-move - Smoothly animated code blocks](https://github.com/shikijs/shiki-magic-move)
- 📦 [Parcel 2.12 - Macros defined with import attributes running at build times](https://parceljs.org/blog/v2-12-0/)
- 📦 [Playwright 1.42 - test tagging, skipped tests annotations](https://github.com/microsoft/playwright/releases/tag/v1.42.0)

---

## 🤭 Fun

[![alt](https://thisweekinreact.com/emails/issues/176/meme.jpg)](https://twitter.com/sebastienlorber/status/1765373471645737153)

See ya! 👋