I have a HOC:
function withNavigationWatcher(Component: React.ComponentType<RouteComponentProps<any>> | React.ComponentType<any>) {
console.log('withNavigationWatcher Component', Component.props)
// eslint-disable-next-line react/display-name
return function (props: any) {
const { setNavigationData } = useNavigation();
useEffect(() => {
setNavigationData({ currentPath: props.match.path });
// eslint-disable-next-line react/destructuring-assignment
}, [props.match.path, setNavigationData]);
return React.createElement(Component, props);
};
}
it is called like a normal function, which is passed the component:
component: withNavigationWatcher(route.component),
So I can only access default props in withNavigationWatcher ? but is it possible to access the props property of component - even if they are not set, is there a reference to this property?