David CaiImplement React Portals in Lit Web ComponentsReact has a createPortal API to render a child node in a container node:Jun 2, 20221Jun 2, 20221
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.Aug 16, 20211Aug 16, 20211
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…Feb 23, 20213Feb 23, 20213
David CaiBatch delete git tags by datesGit commands to batch delete remote and local tags by a specific date and time.May 28, 2020May 28, 2020
David CaiReact Testing Library and the “not wrapped in act” ErrorsHow do I fix the “…not wrapped in act(…)” errors?Apr 30, 202019Apr 30, 202019
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.Jan 15, 2020Jan 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…Dec 31, 20191Dec 31, 20191
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…Feb 13, 2018Feb 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…Dec 20, 2017Dec 20, 2017