Below is an react HOC but I don't understand why such a syntax could work - note that two fat arrows as in Component => props =>?
const withLogging = Component => props => {
useEffect(() => {
fetch(`/logger?location=${ window.location}`);
}, []);
return <Component {...props } />;
};
And when I tried to convert it to typescript, it gives me errors
const withLogging = (Component: React.Component) =>(props: any) => {
useEffect(() => {
fetch(`/logger?location=${ window.location}`);
}, []);
return < Component {...props } />;
};