David CaiImplement React Portals in Lit Web ComponentsReact has a createPortal API to render a child node in a container node:2 min read·Jun 2, 2022----
David CaiMock GraphQL and REST in Storybook and Jest with MSWWalk through how to mock GraphQL or REST responses at network level, and share mocks between Storybook and Jest tests.7 min read·Aug 16, 2021--1--1
David CaiFix Cypress “Invalid or unexpected token” errors in parallel runsCypress test has been working very well for my project. But lately I started to get the mysterious “Invalid or unexpected token” errors…2 min read·Feb 23, 2021--3--3
David CaiBatch delete git tags by datesGit commands to batch delete remote and local tags by a specific date and time.2 min read·May 28, 2020----
David CaiReact Testing Library and the “not wrapped in act” ErrorsHow do I fix the “…not wrapped in act(…)” errors?4 min read·Apr 30, 2020--19--19
David CaiTypeScript 3.7 features you absolutely should useIf I have to choose the most useful features new to TypeScript 3.7, these two are on the very top of the list.2 min read·Jan 15, 2020----
David CaiState Management in React with Reducer but not ReduxI truly believe that if React’s Context and Hook APIs came out before Redux’s inception, the adoption rate of Redux will be much lower…7 min read·Dec 31, 2019--1--1
David CaiCreating a Low Cost and Highly Automated Living Style GuideLiving style guide is an essential tool for designers and developers to create re-usable components. It is a central place to demonstrate…7 min read·Feb 13, 2018----
David CaiCSS in JS and Test-abilityMy company is in the middle of technology migration to move closer to the React ecosystem. We seek a new styling solution to replace SASS…3 min read·Dec 20, 2017----