diff --git a/packages/react-router/docs/api/hooks.md b/packages/react-router/docs/api/hooks.md index 5e0f22742d..cb57e5e7e1 100644 --- a/packages/react-router/docs/api/hooks.md +++ b/packages/react-router/docs/api/hooks.md @@ -121,7 +121,7 @@ you can just ```jsx function BlogPost() { - let match = useMatch("/blog/:slug") + let match = useRouteMatch("/blog/:slug") // Do whatever you want with the match... } ``` diff --git a/packages/react-router/modules/hooks.js b/packages/react-router/modules/hooks.js index f30f429fd0..f2182c8895 100644 --- a/packages/react-router/modules/hooks.js +++ b/packages/react-router/modules/hooks.js @@ -44,7 +44,7 @@ export function useRouteMatch(path) { if (__DEV__) { invariant( typeof useContext === "function", - "You must use React >= 16.8 in order to use useMatch()" + "You must use React >= 16.8 in order to use useRouteMatch()" ); }