NillionNetwork / cra-nillion

create react app with payments enabled nillion javascript client
https://cra-nillion.vercel.app
MIT License
63 stars 85 forks source link

[BUG] quick description of bug #7

Open unknownak04 opened 3 days ago

unknownak04 commented 3 days ago

Duplicate Path Definition in Router

Duplicate / Path Problem: The route definition has two paths set to /. One renders the Layout component, and another renders the OperationsPage component under the same path (/). This could lead to routing conflicts or unexpected behavior since both routes compete to render when the path is /. can anyone fix this??

Jsagar123 commented 3 days ago

Removed duplicate / path:

{
  path: '/',
  element: <OperationsPage />, // Ensure only one definition
}

The second definition of the / path that pointed to OperationsPage was removed. Set OperationsPage as the default route: Instead of giving OperationsPage its own / path, it is now the default child of Layout by using index: true. This way, when the root / is hit, OperationsPage is rendered by default under Layout.