I am trying to redirect from Page 'SalesList.jsx' to 'SalesInvoice.jsx' by clicking a button, but failed to do so. I am getting all the props on button click but unable to call the later page.
I am sharing my code for better understanding:
- calling onSalesView function on button click by passing row value as props
<Table.Row key={id}> <Table.Cell>{row.id}</Table.Cell> <Table.Cell>{row.ServiceNo}</Table.Cell> <Table.Cell>{row.ServiceName}</Table.Cell> <Table.Cell>{row.Cost}</Table.Cell> <Table.Cell> <Dropdown icon='ellipsis vertical' floating direction="left" className='icon'> <Dropdown.Menu> <Dropdown.Item onClick={()=> onSalesView(row) }>Sales Invoice</Dropdown.Item> </Dropdown.Menu> </Dropdown> </Table.Cell> </Table.Row>
- Trying to redirect to the new page with table values. Table values are coming properly, But couldn't accomplish the redirection part.
const onSalesView = (data) => { return <SalesInvoice data={data} /> }