Open in app

Sign in

Write

Sign in

David Cai
David Cai

59 followers

Home

About

Implement React Portals in Lit Web Components

React has a createPortal API to render a child node in a container node:

Jun 2, 2022
2
Portal
Portal
Jun 2, 2022
2

Mock GraphQL and REST in Storybook and Jest with MSW

Walk through how to mock GraphQL or REST responses at network level, and share mocks between Storybook and Jest tests.

Aug 16, 2021
1
Mock GraphQL and REST in Storybook and Jest with MSW
Mock GraphQL and REST in Storybook and Jest with MSW
Aug 16, 2021
1

This is great.

Jun 29, 2021
Jun 29, 2021

Fix Cypress “Invalid or unexpected token” errors in parallel runs

Cypress test has been working very well for my project. But lately I started to get the mysterious “Invalid or unexpected token” errors…

Feb 23, 2021
3
Fix Cypress “Invalid or unexpected token” errors in parallel runs
Fix Cypress “Invalid or unexpected token” errors in parallel runs
Feb 23, 2021
3

Batch delete git tags by dates

Git commands to batch delete remote and local tags by a specific date and time.

May 28, 2020
Batch delete git tags by dates
Batch delete git tags by dates
May 28, 2020

React Testing Library and the “not wrapped in act” Errors

How do I fix the “…not wrapped in act(…)” errors?

Apr 30, 2020
19
React Testing Library and the “not wrapped in act” Errors
React Testing Library and the “not wrapped in act” Errors
Apr 30, 2020
19

TypeScript 3.7 features you absolutely should use

If 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, 2020
TypeScript 3.7 features you absolutely should use
TypeScript 3.7 features you absolutely should use
Jan 15, 2020

State Management in React with Reducer but not Redux

I 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, 2019
1
State Management in React with Reducer but not Redux
State Management in React with Reducer but not Redux
Dec 31, 2019
1

Creating a Low Cost and Highly Automated Living Style Guide

Living style guide is an essential tool for designers and developers to create re-usable components. It is a central place to demonstrate…

Feb 13, 2018
Creating a Low Cost and Highly Automated Living Style Guide
Creating a Low Cost and Highly Automated Living Style Guide
Feb 13, 2018

CSS in JS and Test-ability

My 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, 2017
CSS in JS and Test-ability
CSS in JS and Test-ability
Dec 20, 2017
David Cai

David Cai

59 followers

Gamer, hiker, reader, and programmer

Following
  • The Medium Blog

    The Medium Blog

  • 🪄 OZ 🎩

    🪄 OZ 🎩

  • Daniel Tello

    Daniel Tello

  • Jared Hawkins

    Jared Hawkins

  • Astrid Usong

    Astrid Usong

See all (44)

Help

Status

About

Careers

Press

Blog

Privacy

Rules

Terms

Text to speech