MCPcopy Create free account
hub / github.com/DesignRevision/shards-dashboard-react /

Class

src/withTracker.js:22–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20
21 // eslint-disable-next-line
22 const HOC = class extends Component {
23 componentDidMount() {
24 // eslint-disable-next-line
25 const page = this.props.location.pathname + this.props.location.search;
26 trackPage(`${BASENAME}${page}`);
27 }
28
29 componentDidUpdate(prevProps) {
30 const currentPage =
31 prevProps.location.pathname + prevProps.location.search;
32 const nextPage =
33 this.props.location.pathname + this.props.location.search;
34
35 if (currentPage !== nextPage) {
36 trackPage(`${BASENAME}${nextPage}`);
37 }
38 }
39
40 render() {
41 return <WrappedComponent {...this.props} />;
42 }
43 };
44
45 return HOC;
46};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected