Skip to content

Commit cac5241

Browse files
Merge pull request #210164 from AnuragSingh-MSFT/patch-10
(AzureCXP) fixes MicrosoftDocs/azure-docs#97350
2 parents 5c9b0da + 3558a9e commit cac5241

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

articles/azure-monitor/app/javascript-react-plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ The `useTrackEvent` Hook is used to track any custom event that an application m
181181
- Application Insights instance (which can be obtained from the `useAppInsightsContext` Hook).
182182
- Name for the event.
183183
- Event data object that encapsulates the changes that has to be tracked.
184-
- skipFirstRun (optional) flag to skip calling the `trackEvent` call on initialization. Default value is set to `true`.
184+
- skipFirstRun (optional) flag to skip calling the `trackEvent` call on initialization. Default value is set to `true` to mimic more closely the way the non-hook version works. With `useEffect` hooks, the effect is triggered on each value update _including_ the initial setting of the value, thereby starting the tracking too early causing potentially unwanted events to be tracked.
185185

186186
```javascript
187187
import React, { useState, useEffect } from "react";

0 commit comments

Comments
 (0)