Adding <Link> component inside tablecell causes page refresh when clicked.
ActionCoding opened this issue · comments
Hi All,
I have a datatable setup with a link to view a detail page using the component. I use this on all other parts of my SPA and it routes the user to the correct path without page refresh but when I use it inside a dataTable it causes page refresh. Any idea why this is happening only inside the dataTable?
Can you create a demo as a jsfiddle?
…On Wed, Jul 19, 2023, 14:44 Michael P McCoy ***@***.***> wrote:
Hi All,
I have a datatable setup with a link to view a detail page using the
component. I use this on all other parts of my SPA and it routes the user
to the correct path without page refresh but when I use it inside a
dataTable it causes page refresh. Any idea why this is happening only
inside the dataTable?
—
Reply to this email directly, view it on GitHub
<#315>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAERMOGYLFEDWS3GBBY42ZTXQ7JDPANCNFSM6AAAAAA2P3YTRM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
Basically, datatable is converting jsx into a string so adding a Link component from react-router-dom is changed into a standard <a tag which react reloads the page when clicked as opposed to looking for a page component.
ok, but that is not a demo. Please provide one and reopen this issue.