Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140788

trying to send querystring parameters to another page using reactJS

$
0
0

I am trying to send querystring parameters to another page using history object in the button click event like as below

const viewChange = (record) => {
debugger;
history.push('/Viewchange?id=record.id&dataid=record.dataid');
};

and this is route where i have defined in routes.js file

{
  path: '/Viewchange/:id/:dataid',
  exact: true,
  title: 'Viewchange',
  icon: 'dashboard',
  breadcrumbs: ['dashboard'],
  contentComponent: ViewChangeRequest,
  isEnabled: () => false,
},

some how i am getting an empty page with url below

http://localhost:3000/Viewchange?id=record.id&dataid=record.dataid#

I am not sure where i am doing wrong in this case, Could any one please let me know how to attach querystring values to url the below code is the component which i am going to redirect

 const ViewChangeRequest = (props) => {
  };
  export default withRouter(ViewChangeRequest);

many thanks in advance


Viewing all articles
Browse latest Browse all 140788

Latest Images

Trending Articles



Latest Images

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