React History and Match objects in Props

Code Snippets 4 U

History Object:-

{
  "length": 17,
  "action": "POP",
  "block" : f block()
  "createHref" : f createHref(location),
  "go": f go(n),
  "goBack": f goBack(),
  "goForward": f goForward(),
  "listen": f listen(listener),
  "location": {
    "pathname": "/home",
    "search": "",
    "hash": "",
    "push": f push(path, state),
    "replace": f replace(path, state)
  }
}

Match object: –

"match": {
    "path": "/home/:postId/contents",
    "url": "/post/2437360a-685f-489b-af0c-c1f00e58331/contents",
    "isExact": true,
    "params": {
      "postId": "2437360a-685f-489b-af0c-c1f00e58331"
    }

Leave a Reply

Your email address will not be published. Required fields are marked *

fifty one − forty eight =