-
Notifications
You must be signed in to change notification settings - Fork 0
Router
Lennart Czardybon edited this page Mar 28, 2023
·
1 revision
This project uses react-router v6's HashRouter, as it works with static websites. To modify or extend the routing in src/App.tsx, follow these steps: First, create a new component in the src/routes/ directory and import it into the file. Then, add the component to a new Route element, specifying the path. Finally, use the navigation function (via useNavigation) to redirect the web application to the desired page.
The HomePage, GraphPage, and AlgorithmPage are each deployed at their own routes. The later two are specific to the selected algorithm, and therefore only accessible as subpath of /:algorithm, best explained in an example:
- find
HomePageat localhost:3000/#/ - find Dijkstra's
GraphPageat localhost:3000/#/dijkstra/graph - find Dijkstra's
AlgorithmPageat localhost:3000/#/dijkstra/algrithm