Extracting HOC tracked component class base for re-use #1829
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While withAITracking function is working in most of the cases, it's not useful in a scenario when a content of the wrapped component is not physically located under the component's DOM tree.
An example of that is Modal component from Microsoft Fluent UI framework but there are many other similar cases too.
Therefore, a developer may sometimes need to create a custom version of the HOC function, which for example, as in the case of the Modal component would wrap a content instead of the component itself, however still have the same tracking functionality as the app insights library HOC function.
The change here extract the HOC class so it can be re-used and customized by consumers of the library