useReducer is an often forgotten, but extremely powerful, hook in React. It can replace many cases you might be using useState, with a number of advantages and very little overhead.
Build internal tools 10x faster using pre-built React components (sponsor)
Visually design apps that interface with any database or API. Switch to code nearly anywhere to customize how your apps look and work. With Retool, you ship more apps and move your business forward—all in less time. Thousands of teams at companies like Amazon, DoorDash and NBC collaborate around custom-built Retool apps to solve internal workflows. And now teams of up to 5 can build unlimited Retool apps for free.
Writing Custom Hooks with React
If you’ve done any React development, you’ve probably heard of “hooks” in components. Hooks enable you to reuse logic across your project’s components. Hooks help minimize repetition of code, and also make your project’s easier to maintain. React has a few “built in” hooks, but also allows you to build your own.
How We Rebuilt React DevTools with Replay Routines
A deep dive into using time-travel debugging superpowers to analyze recordings and extract React DevTools data.
Advanced Unit Testing in React with Jest: Hooks and Promises
Unit testing is essential in every codebase, and React is no exception. However, as the code becomes more complex, patterns and challenges are faced that go beyond the conventional cases. I have found that creating these specific unit tests allowed me to get a better understanding of how React works under the hood.
As developers, we don’t like working with forms, but they’re a critical part of most web applications! In this tutorial, you’ll learn exactly how to wire up all of the different form controls in React. Never forget how to data-bind a checkbox or radio button again!
Function Composition in Large React Applications: Best Practices and Real-World Examples
Function composition is a powerful technique for building complex functionality by combining simple, reusable functions. In the context of React, function composition can be used to create more sophisticated and reusable components, improving the organization and structure of code in larger applications.
Little React Things: React applications are functions
Little React Things is a series of short, React-focused posts where I share some things I’ve learned over the past few years of developing with React. I hope you find them helpful. These posts might be most helpful for those who have at least a little experience with React already.
useReducer 是 React 中一个经常被遗忘但非常强大的钩子。它可以取代您可能使用 useState 的许多情况,具有许多优点和很少的开销。
使用预构建的 React 组件构建内部工具速度提高 10 倍(赞助商)
直观地设计与任何数据库或 API 交互的应用程序。几乎可以在任何地方切换到代码来自定义应用程序的外观和工作方式。借助 Retool,您可以在更短的时间内发布更多应用程序并推动业务发展。 Amazon、DoorDash 和 NBC 等公司的数千个团队围绕定制的 Retool 应用程序进行协作,以解决内部工作流程。现在,最多 5 人的团队可以免费构建无限的 Retool 应用程序。
如果您做过 React 开发,您可能听说过组件中的“钩子”。挂钩使您能够在项目的组件中重用逻辑。挂钩有助于最大程度地减少代码重复,并使项目更易于维护。 React 有一些“内置”钩子,但也允许您构建自己的钩子。
深入探讨如何使用时间旅行调试超能力来分析记录并提取 React DevTools 数据。
React with Jest 中的高级单元测试:Hooks 和 Promises
单元测试在每个代码库中都是必不可少的,React 也不例外。然而,随着代码变得越来越复杂,面临着超出传统情况的模式和挑战。我发现创建这些特定的单元测试可以让我更好地了解 React 的工作原理。
作为开发人员,我们不喜欢使用表单,但它们是大多数 Web 应用程序的关键部分!在本教程中,您将准确学习如何在 React 中连接所有不同的表单控件。永远不要忘记如何再次对复选框或单选按钮进行数据绑定!
函数组合是一种通过组合简单、可重用函数来构建复杂功能的强大技术。在 React 的上下文中,函数组合可用于创建更复杂和可重用的组件,从而改进大型应用程序中代码的组织和结构。
Little React Things 是一系列以 React 为中心的简短帖子,我在其中分享了过去几年使用 React 开发时学到的一些东西。我希望它们对您有所帮助。这些帖子对于那些至少已经有一点 React 经验的人来说可能是最有帮助的。
发布者