Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70818

Passing interface other than string through Route

$
0
0

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

Read full topic


Viewing all articles
Browse latest Browse all 70818

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>