MealWrapper.jsx 802 B

1234567891011121314151617181920212223242526
  1. import { Route, Routes } from "react-router-dom";
  2. import React from "react";
  3. import OwnMeals from "./OwnMeals";
  4. import AddMeal from "./AddMeal";
  5. import EditMeal from "./EditMeal";
  6. import MealDetailView from "./MealDetailView";
  7. /** Wrapper component for Meals. Makes sure that Meals component receives the complete routing path to render the correct view.
  8. *
  9. * Might become obsolete in a future version if routing is properly handled by Meals */
  10. const MealWrapper = () => {
  11. return (
  12. <>
  13. <Routes>
  14. <Route index element={<OwnMeals />} />
  15. <Route path="add" element={<AddMeal />} />
  16. <Route path={'detail/:mealId'} element={<MealDetailView />} />
  17. <Route path={'edit/:mealId'} element={<EditMeal />} />
  18. </Routes>
  19. </>
  20. );
  21. }
  22. export default MealWrapper;