From bb9b4fdc597dc29b7451723a5351b6cd16d5c1be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=96=87=E5=AF=8C?= Date: Sun, 29 Sep 2019 22:28:46 +0800 Subject: [PATCH] Fix typo: useMatch -> useRouteMatch (#6948) --- packages/react-router/docs/api/hooks.md | 2 +- packages/react-router/modules/hooks.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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()" ); }