'Is it possible to handle object in the body of RouteComponentProps

I have a config route file like this

<PrivateRoute
   exact
   path="/:id/:title"
   parentClass="theme-1"
   component={PostOnePage} />

and have a component like this

type TParams = { id: string, title: string};

const PostOnePage = ({ match }: RouteComponentProps<TParams>) => {
    const id = match.params.id;
    const title = match.params.title;
    return <></>;
}

the id and title were extracted from an object containing the id, title, content, category, date ...

So, Instead of creating a request to get all these data, I would love to know if I can pass the whole of the object in the body.

Any answer I will appreciate.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source