Skip to content

Commit 915cfe9

Browse files
committed
Update README.md
1 parent c66136d commit 915cfe9

File tree

1 file changed

+13
-61
lines changed

1 file changed

+13
-61
lines changed

packages/scan/README.md

Lines changed: 13 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -335,113 +335,65 @@ export interface Options {
335335
* @default true
336336
*/
337337
enabled?: boolean;
338-
/**
339-
* Include children of a component applied with withScan
340-
*
341-
* @default true
342-
*/
343-
includeChildren?: boolean;
344338

345339
/**
346-
* Enable/disable geiger sound
340+
* Force React Scan to run in production (not recommended)
347341
*
348-
* @default true
342+
* @default false
349343
*/
350-
playSound?: boolean;
351-
344+
dangerouslyForceRunInProduction?: boolean;
352345
/**
353346
* Log renders to the console
354347
*
348+
* WARNING: This can add significant overhead when the app re-renders frequently
349+
*
355350
* @default false
356351
*/
357352
log?: boolean;
358353

359354
/**
360355
* Show toolbar bar
361356
*
357+
* If you set this to true, and set {@link enabled} to false, the toolbar will still show, but scanning will be disabled.
358+
*
362359
* @default true
363360
*/
364361
showToolbar?: boolean;
365362

366-
/**
367-
* Render count threshold, only show
368-
* when a component renders more than this
369-
*
370-
* @default 0
371-
*/
372-
renderCountThreshold?: number;
373-
374-
/**
375-
* Clear aggregated fibers after this time in milliseconds
376-
*
377-
* @default 5000
378-
*/
379-
resetCountTimeout?: number;
380-
381-
/**
382-
* Maximum number of renders for red indicator
383-
*
384-
* @default 20
385-
* @deprecated
386-
*/
387-
maxRenders?: number;
388-
389-
/**
390-
* Report data to getReport()
391-
*
392-
* @default false
393-
*/
394-
report?: boolean;
395-
396-
/**
397-
* Always show labels
398-
*
399-
* @default false
400-
*/
401-
alwaysShowLabels?: boolean;
402-
403363
/**
404364
* Animation speed
405365
*
406366
* @default "fast"
407367
*/
408368
animationSpeed?: "slow" | "fast" | "off";
409369

410-
/**
411-
* Smoothly animate the re-render outline when the element moves
412-
*
413-
* @default true
414-
*/
415-
smoothlyAnimateOutlines?: boolean;
416-
417370
/**
418371
* Track unnecessary renders, and mark their outlines gray when detected
419372
*
420-
* An unnecessary render is defined as a component re-rendering with no change to the component's corresponding dom subtree (e.g. a component re-rendered, but nothing in the components UI did not change)
373+
* An unnecessary render is defined as the component re-rendering with no change to the component's
374+
* corresponding dom subtree
421375
*
422-
* @default true
376+
* @default false
423377
* @warning tracking unnecessary renders can add meaningful overhead to react-scan
424378
*/
425379
trackUnnecessaryRenders?: boolean;
426380

427381
onCommitStart?: () => void;
428-
onRender?: (fiber: Fiber, render: Render) => void;
382+
onRender?: (fiber: Fiber, renders: Array<Render>) => void;
429383
onCommitFinish?: () => void;
430-
onPaintStart?: (outlines: PendingOutline[]) => void;
431-
onPaintFinish?: (outlines: PendingOutline[]) => void;
384+
onPaintStart?: (outlines: Array<Outline>) => void;
385+
onPaintFinish?: (outlines: Array<Outline>) => void;
432386
}
433387
```
434388

435389
</details>
436390

437391
- `scan(options: Options)`: Imperative API to start scanning
438392
- `useScan(options: Options)`: Hook API to start scanning
439-
- `withScan(Component, options: Options)`: Whitelist a specific component, do not scan other components
440393
- `getReport()`: Get a report of all the renders
441394
- `setOptions(options: Options): void`: Set options at runtime
442395
- `getOptions()`: Get the current options
443396
- `onRender(Component, onRender: (fiber: Fiber, render: Render) => void)`: Hook into a specific component's renders
444-
- `getRenderInfo(Component)`: Get the render info for a specific component
445397

446398
## Why React Scan?
447399

0 commit comments

Comments
 (0)