import React, { useContext } from "react"; import hoistNonReactStatics from "hoist-non-react-statics"; import { AnalyticsContext } from "./context"; import { AnalyticsContextValue } from "./types"; export function withAnalytics

( WrappedComponent: React.ComponentType

) { const WithAnalytics = (props: P & AnalyticsContextValue): JSX.Element => { const context = useContext(AnalyticsContext); return ; }; return hoistNonReactStatics(WithAnalytics, WrappedComponent, {}); }