Answers for "difference between useHistory and props.history"

0

difference between useHistory and props.history

//You can use useHistory() in any component, 
//but props.history only in components where the history is available in props

//When you use history.push, you do NOT have to specify the pathname. 

const queryString = new URLSearchParams(params).toString()
    history.push({
      search: "?" + queryString
    });
Posted by: Guest on May-05-2020

Code answers related to "difference between useHistory and props.history"

Code answers related to "Javascript"

Browse Popular Code Answers by Language