index.tsx

import "./wdyr";

wdyr.ts

import whyDidYouRender from "@welldone-software/why-did-you-render";
import React from "react";

if (process.env.NODE_ENV === "development") {
console.log("whyDidYouRender enabled!");
whyDidYouRender(React, {
trackAllPureComponents: true,
});
}

component

// DrawerRight.whyDidYouRender = true;