David Cai·Jun 2, 2022Implement React Portals in Lit Web ComponentsReact has a createPortal API to render a child node in a container node:A response icon2A response icon2
David Cai·Aug 16, 2021Mock 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.A response icon1A response icon1
David Cai·Feb 23, 2021Fix 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…A response icon3A response icon3
David Cai·May 28, 2020Batch delete git tags by datesGit commands to batch delete remote and local tags by a specific date and time.
David Cai·Apr 30, 2020React Testing Library and the “not wrapped in act” ErrorsHow do I fix the “…not wrapped in act(…)” errors?A response icon19A response icon19
David Cai·Jan 15, 2020TypeScript 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.
David Cai·Dec 31, 2019State 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…A response icon1A response icon1
David Cai·Feb 13, 2018Creating 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…
David Cai·Dec 20, 2017CSS 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…