From 1e8ab4b2c120a210921ca9eafbc0f98d355c2b33 Mon Sep 17 00:00:00 2001 From: Maicarons J <101958587+Maicarons2022@users.noreply.github.com> Date: Tue, 16 Aug 2022 19:15:41 +0800 Subject: [PATCH] doc: add react-router to routing.mdx (#1755) --- website/docs/guides/routing.mdx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/website/docs/guides/routing.mdx b/website/docs/guides/routing.mdx index 3e1f255d..bdcd49b2 100644 --- a/website/docs/guides/routing.mdx +++ b/website/docs/guides/routing.mdx @@ -24,4 +24,24 @@ The recommended approach for routing in Angular is [HashLocationStrategy](https: ```ts RouterModule.forRoot(routes, {useHash: true}) -``` \ No newline at end of file +``` + +## React + +The recommended approach for routing in React is [HashRouter](https://reactrouter.com/docs/en/v6/routers/hash-router): + +```jsx +import { HashRouter } from "react-router-dom"; + +ReactDOM.render( + + {/* The rest of your app goes here */} + + } exact /> + } /> + } /> + {/* more... */} + + , + root); +```