Hello I´m using react router and I need to pass some querystring parameters
tried with
You need to use the library you don't need to add the query string in the Route:
Here is an example:
import React from "react"; var qs = require("qs");
const Home = props => {
console.log(props.location.search);
const query = qs.parse(props.location.search, {
ignoreQueryPrefix: true
});
console.log(query);
return (
Welcome to the Tornadoes Website!
);
};
export default Home;
CodesandBox Example: https://codesandbox.io/s/a-simple-react-router-v4tutorial-mw9b4