Answers for "write data in props.histroy.push in react component"

0

write data in props.histroy.push in react component

history.push({pathname:"/yourroute",state: {_id: "0001", name: "AZ"}})
Posted by: Guest on June-04-2021
0

Read data in props.histroy.push in react component

import React from 'react';

const YourRoute = props=> {
    const { _id, name } = (props.location && props.location.state) || {};
        //_id and name will contain the passed data
     .
     .
     .

}
Posted by: Guest on June-04-2021

Code answers related to "write data in props.histroy.push in react component"

Code answers related to "Javascript"

Browse Popular Code Answers by Language