PejmanNik / jikji

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

Rendering issue while using map #10

Closed sharathm89 closed 1 year ago

sharathm89 commented 1 year ago

Below code works but can't use since its kind of hardcoding

{
  data.employeeList ? (
    <>
      <DataView list={data.employeeList[0]} />
      <PageBreak />
      <DataView list={data.employeeList[1]} />
      <PageBreak />
      <DataView list={data.employeeList[2]} />
    </>
  ) : null
}

Using map it works but It displays data in single page and PageBreak doesn't happen

data.employeeList.map((subList, index) => (
  <React.Fragment key={index} >
    <DataView list={subList} />
    <PageBreak />
  </React.Fragment>
))
PejmanNik commented 1 year ago

Thank you for reporting it, The page break doesn't work in the Fragment components. It will be fixed in the next version but until i release it, you can replace the Fragment with any Html component

sharathm89 commented 1 year ago

Thank you for reporting it, The page break doesn't work in the Fragment components. It will be fixed in the next version but until i release it, you can replace the Fragment with any Html component

Thanks... let me check it