Hi there,
I’m attempting to pass an interface through IonReacRouter
using Route
as follows:
<Route path={`/tab2/topics/:title`} component={TopicsCategory} />
In one of my page, I’m attempting to route to the designated page as follows:
<IonItem lines="none" class="section-header" routerLink={"/tab2/topics/"+"titleID"}>
In the targeted page, I defined an interface with a component accessing the string variable within:
interface TopicsCategoryProps extends RouteComponentProps<{
title: string;
}> {}
const TopicsCategory: React.FC<TopicsCategoryProps> = ({match}) => {
return (
{match.params.title}
);
The problem is that RouteComponentProps
only allows string
variable to be passed between pages while I need to pass an entire interface
containing other types across pages. Is there any discussion that I can refer to? Thanks!
Eugene
1 post - 1 participant