-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
wdyr.ts
28 lines (24 loc) · 937 Bytes
/
wdyr.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Implements Why Did You Render (WDYR) in Dev
import type WhyDidYouRender from '@welldone-software/why-did-you-render';
import React from 'react';
import Config from 'react-native-config';
const useWDYR = Config?.USE_WDYR === 'true';
if (useWDYR) {
const whyDidYouRender = require<typeof WhyDidYouRender>('@welldone-software/why-did-you-render');
whyDidYouRender(React, {
// Enable tracking in all pure components by default
trackAllPureComponents: true,
include: [
// Uncomment to enable tracking in all components. Must also uncomment /^Screen/ in exclude.
// /.*/,
// Uncomment to enable tracking by displayName, e.g.:
// /^Avatar/,
// /^ReportActionItem/,
// /^ReportActionItemSingle/,
],
exclude: [
// Uncomment to enable tracking in all components
// /^Screen/
],
});
}