You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
Is your feature request related to a problem? Please describe.
I'd like to use MatomoInstance consistently. useMatomo hook returns type not matching with the return type of createInstance.
I'd like to pass matomo client returned by useMatomo as typed by MatomoInstance.
Describe the solution you'd like
MatomoProvider takes MatomoInstance as a value which is defined as:
Argument of type '{ trackEvent: (params: TrackEventParams) => void | undefined; trackEvents: () => void | undefined; trackPageView: (params: TrackPageViewParams) => void | undefined; trackSiteSearch: (params: TrackSiteSearchParams) => void | undefined; trackLink: (params: TrackLinkParams) => void | undefined; enableLinkTracking: () =...' is not assignable to parameter of type 'MatomoInstance'.
The types returned by 'pushInstruction(...)' are incompatible between these types.
Type 'void' is not assignable to type 'MatomoTracker'.
Why not have simply
declare function useMatomo(): MatomoInstance;
Describe alternatives you've considered
I defined my own interface with a subset of functions I'm using:
Is your feature request related to a problem? Please describe.
I'd like to use MatomoInstance consistently. useMatomo hook returns type not matching with the return type of createInstance.
I'd like to pass matomo client returned by useMatomo as typed by
MatomoInstance
.Describe the solution you'd like
MatomoProvider takes MatomoInstance as a value which is defined as:
, but useMatomo returns very close type, but different:
The difference:
Why not have simply
Describe alternatives you've considered
I defined my own interface with a subset of functions I'm using:
But it only works because I'm not using pushInstruction I believe.
Additional context
Using version "0.3.1", updated to 0.5.1 but the types are defined still in the same way.
The text was updated successfully, but these errors were encountered: