---
title: "Comment by Saurav Pratap Singh on \"Create a layout component in react\" | Hashnode"
description: "Inside the children you have kept /about, in react-router-dom when you keep / at the start of a path, you make it absolute and absolute paths cannot be used ins"
url: "https://hashnode.com/posts/create-a-layout-component-in-react/68c96da7958fbd41da260b10/comment/68caf120b1415523fa002f49"
---

[Discussion](https://hashnode.com/posts/create-a-layout-component-in-react/68c96da7958fbd41da260b10)

Comment [Create a layout component in react](https://hashnode.com/posts/create-a-layout-component-in-react/68c96da7958fbd41da260b10)

[Saurav Pratap Singh](https://hashnode.com/@saurav26)

[Sep 17, 2025](https://hashnode.com/posts/create-a-layout-component-in-react/68c96da7958fbd41da260b10/comment/68caf120b1415523fa002f49)

Inside the children you have kept /about, in react-router-dom when you keep / at the start of a path, you make it absolute and absolute paths cannot be used inside the children itself, right now it will work, but if for going to MainLayout the path was /main then to goto about page the path would need to be /main/about which will fail in your case, because you are placing an absolute path as a children, FIX: remove / from the children path and for Home, you can use index: true instead of assigning it a path, keep coding !
