Skip to content

Instantly share code, notes, and snippets.

View bitttttten's full-sized avatar
👻
hello

bitttttten

👻
hello
View GitHub Profile
export default function transformer(file, api, options) {
const j = api.jscodeshift;
const root = j(file.source);
const removeIfUnused = (importSpecifier, importDeclaration) => {
const varName = importSpecifier.value.local.name;
if (varName === "React") {
return false;
}
@bitttttten
bitttttten / index.md
Created June 7, 2024 15:03 — forked from bvaughn/index.md
How to use profiling in production mode for react-dom

React recently introduced an experimental profiler API. This page gives instructions on how to use this API in a production release of your app.

Table of Contents

Profiling in production

React DOM automatically supports profiling in development mode for v16.5+, but since profiling adds some small additional overhead it is opt-in for production mode. This gist explains how to opt-in.