PejmanNik / jikji

Effortless report generator and reporting tools with React and NodeJS
https://jikji.xyz
MIT License
45 stars 1 forks source link

Pass parameter in Route #25

Closed sharathm89 closed 11 months ago

sharathm89 commented 11 months ago

Passing a path parameter doesn't seem to work.

For ex: Based on id it needs to fetch different kind of data so in that case passing as path parameter would be easy.

Lmk if there is some other way to achieve it.

Sample Code

const DefaultApp = () => (
  <Container>
    <h2>Report App</h2>
    <br />
    <a href="invoice/67">67 Test</a>
  </Container>
);

const App = () => (
  <BrowserRouter>
    <Route path="invoice/:id" component={Invoice} />
    <Route path="" component={DefaultApp} isDefault />
  </BrowserRouter>
);

https://github.com/PejmanNik/jikji/assets/17666778/eac4c5fe-482f-4109-b676-0ce2d2e871ff

PejmanNik commented 11 months ago

The router component is very simple and just exists to cover the basic usage without a third-party library, as this library attempt to handle reports I don't want to focus on routing, there are several advanced router components for React you can use. for instance react-router

sharathm89 commented 11 months ago

The router component is very simple and just exists to cover the basic usage without a third-party library, as this library attempt to handle reports I don't want to focus on routing, there are several advanced router components for React you can use. for instance react-router

Thanks

PejmanNik commented 11 months ago

No problem 👍