CodeYogi
CodeYogi

Reputation: 1399

Url Params in React with React Router

Does anyone know how to get the URL params in React when using React Router?

I'm trying to do something like this:

filterList(key) {
   if (key===this.props.location.query){
    return Blogstore.state.blog
   }

to match with the unique key at the end of my link:

http://localhost:8080/blogshow/-KGYsxaXyMiej5cgU5A7

Upvotes: 1

Views: 236

Answers (1)

CodeYogi
CodeYogi

Reputation: 1399

The answer is:

this.props.routeParams.key

Upvotes: 2

Related Questions