サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
レイングッズ
kentcdodds.com
JavaScript to Know for ReactJuly 15th, 2020 — 14 min read One of the things I love most about React compared to other frameworks that I've used is how exposed you are to JavaScript when you're using it. There's no template DSL (JSX compiles to sensible JavaScript), the component API has only gotten simpler with the addition of React Hooks, and the framework offers you very little abstraction outsi
5 Tips to Help You Avoid React Hooks PitfallsAugust 5th, 2019 — 13 min read The React Hooks feature was proposed in October 2018 and released ~4 months later in February 2019. Since then, people have been rapidly learning and adopting hooks in their production codebases because hooks drastically simplify the management of state and side effects in applications. It definitely took its rightful plac
A little before and after optimization on a react component. I didn't use any memoization to accomplish this, yet I was able to go from a 13.4ms to a 3.6ms render. I also didn't do anything besides move code into an extra component, which ended up cutting out 27 lines of code. Excited? Let's break it down with a simple contrived example and then talk about what practical application this has for y
reviewpersonalcareerreactnodedatabasesremixtypescriptuser experiencecsstestingjavascriptproductivityopen sourceprogrammingteachingstateperformancelearning
There, that should do it... Why is useCallback worse?! We hear a lot that you should use React.useCallback to improve performance and that "inline functions can be problematic for performance," so how could it ever be better to not useCallback? Just take a step back from our specific example, and even from React and consider this: Every line of code which is executed comes with a cost. Let me refa
The State Reducer Pattern with React HooksApril 6th, 2020 — 12 min read Some History A while ago, I developed a new pattern for enhancing your React components called the state reducer pattern. I used it in downshift to enable an awesome API for people who wanted to make changes to how downshift updates state internally. If you're unfamiliar with downshift, just know that it's an "enhanced input"
Managing state is arguably the hardest part of any application. It's why there are so many state management libraries available and more coming around every day (and even some built on top of others... There are hundreds of "easier redux" abstractions on npm). Despite the fact that state management is a hard problem, I would suggest that one of the things that makes it so difficult is that we ofte
I've been a blogger for over 15 years. When I was a teenager, I had a blog on blogger all about what Google was working on. I was one of the first bloggers to report on Google's acquisition of YouTube (my blog got an insane number of views that day). I also used to write (on blogger) one called "Google Video Highlights" where I and some random stranger I "met" on the internet would take turns post
useEffect vs useLayoutEffectDecember 1st, 2020 — 3 min read Both of these can be used to do basically the same thing, but they have slightly different use cases. So here are some rules for you to consider when deciding which React Hook to use. useEffect 99% of the time this is what you want to use. When hooks are stable and if you refactor any of your class components to use hooks, you'll likely m
I remember a few years ago when I got started with React I decided I needed to figure out how to test React components. I tried shallow from enzyme and immediately decided that I would never use it to test my React components. I've expressed this feeling on many occasions and get asked on a regular basis why I feel the way I do about shallow rendering and why React Testing Library will never suppo
The goal of this post is to not only help you understand what prop drilling is (some also refer to it as "threading"), but also when it can be a problem and mechanisms you can use to side-step or avoid it. What is prop drilling? Prop drilling (also called "threading") refers to the process you have to go through to get data to parts of the React Component tree. Let's look at a very simple example
Introducing the react-testing-library 🐐April 2nd, 2018 — 10 min read Two weeks ago, I wrote a new library! I've been thinking about it for a while. But two weeks ago I started getting pretty serious about it: I'm seriously starting to think that I should make my own (very small) testing lib and drop enzyme entirely. Most of enzyme's features are not at all useful (and many damaging) to my testbas
But really, what is a JavaScript test?January 1st, 2018 — 9 min read Testing software. There are a ton of reasons we do it. Here are two of mine: Speeds up my workflow so I can develop software faster Helps me ensure I don't break existing code when making changes That said, I have a few questions for you (these are twitter polls): Have you ever written a JavaScript test? Have you ever used a Java
Effective Snapshot TestingOctober 30th, 2017 — 9 min read I guess I've been on a bit of a testing kick recently, I promise this newsletter will delve into more stuff later. But I saw this tweet from Justin Searls (a developer who I admire with a great deal of experience in testing) and thought it would be a great subject to write about. In that tweet, Justin shares a screenshot of a bunch of his t
Advanced React Component PatternsDecember 5th, 2017 — 7 min read I don't know that I've ever been more excited about an egghead.io course release before (having personally published over 100 videos on egghead, that's saying something...). Two of my courses will be (have now been) released as part of egghead's annual Christmas course release celebration 🎉 One is The Beginner's Guide to ReactJS and
Learn React Fundamentals 🆓 and Advanced Patterns ⚛️ 🎁December 4th, 2017 — 5 min read I couldn't be more excited to introduce you to what I can call my best work to date: Two new video courses available now on egghead.io! The beginner material is free forever and the advanced stuff is worth a subscription so I encourage you to give them a look! The Beginner's Guide to ReactJS Introduction to The
Making your UI tests resilient to changeOctober 7th, 2019 — 6 min read You're a developer and you want to avoid shipping a broken login experience, so you're writing some tests to make sure you don't. Let's get a quick look at an example of such a form: const form = ( <form onSubmit={handleSubmit}> <div> <label htmlFor="username">Username</label> <input id="username" className="username-field" />
Introducing downshift 🏎 for React ⚛️August 23rd, 2017 — 10 min read downshift 🏎 is the primitive you need to build simple, flexible, WAI-ARIA compliant React autocomplete/typeahead/dropdown/select/combobox/etc (AKA "item selection") (p)react ⚛️ components. From PayPal 💙 One common component on the web is autocomplete: I've personally implemented 5 unique autocomplete abstractions in the last 4
Write tests. Not too many. Mostly integration.July 13th, 2019 — 6 min read A while back, Guillermo Rauch (creator of Socket.io and founder of Zeit.co (the company behind a ton of the awesome stuff coming out lately)) tweeted something profound: 𝕏 post data not available: https://twitter.com/rauchg/status/807626710350839808 Write tests. Not too many. Mostly integration. This is deep, albeit short
I've started doing something recently that's been really rewarding. I'm the maintainer of angular-formly a fairly popular library for forms with AngularJS. I've committed a lot of code and the library has 33 contributors right now. For at least five of these contributors, it was their first time contributing to an open source library. I've tried really hard to make it easy to contribute to angular
このページを最初にブックマークしてみませんか?
『Kent C. Dodds』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く