I would like to have my Clubs get data straight from its parent. In the example below. other props such as data and setData are both available. but not id which should be given by the path.
<AuthRoute path="/club/:id">
<Club data={data} setData={setData} />
</AuthRoute>
const AuthRoute = ({ children, ...props }) => {
const { isAuthenticated } = useAuth();
return (
<Route {...props}>
{isAuthenticated ? children : <Redirect to="/login" />}
</Route>
);
};
export const Club = (props) => {
console.log(props);
return <div>Hello World</div>;
};