File tree Expand file tree Collapse file tree 4 files changed +7
-4
lines changed
packages/browser-utils/src/metrics/web-vitals/types Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ export interface ReportOpts {
116116}
117117
118118export interface AttributionReportOpts extends ReportOpts {
119- generateTarget ?: ( el : Node | null ) => string ;
119+ generateTarget ?: ( el : Node | null ) => string | undefined ;
120120}
121121
122122/**
Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ export interface CLSAttribution {
3434 * By default, a selector identifying the first element (in document order)
3535 * that shifted when the single largest layout shift that contributed to the
3636 * page's CLS score occurred. If the `generateTarget` configuration option
37- * was passed, then this will instead be the return value of that function.
37+ * was passed, then this will instead be the return value of that function,
38+ * falling back to the default if that returns null or undefined.
3839 */
3940 largestShiftTarget ?: string ;
4041 /**
Original file line number Diff line number Diff line change @@ -60,7 +60,8 @@ export interface INPAttribution {
6060 * occurred. If this value is an empty string, that generally means the
6161 * element was removed from the DOM after the interaction. If the
6262 * `generateTarget` configuration option was passed, then this will instead
63- * be the return value of that function.
63+ * be the return value of that function, falling back to the default if that
64+ * returns null or undefined.
6465 */
6566 interactionTarget : string ;
6667 /**
Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ export interface LCPAttribution {
3434 * By default, a selector identifying the element corresponding to the
3535 * largest contentful paint for the page. If the `generateTarget`
3636 * configuration option was passed, then this will instead be the return
37- * value of that function.
37+ * value of that function, falling back to the default if that returns null
38+ * or undefined.
3839 */
3940 target ?: string ;
4041 /**
You can’t perform that action at this time.
0 commit comments