You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I might be "pushing the limits" of react-table with this, but I want to be able to export it into PDF (in an electron app). My approach so far consists of rendering the table with a React.renderToStaticMarkup as I don't need to put it in the DOM. With the resulting html I'm opening a new invisible BrowserWindow (electron) where I can then print it to PDF.
The problem: React.renderToStaticMarkup, normally used on SSR, doesn't like useLayoutEffect and it throws a bunch of warnings if it catches one.
But still, would it be possible to control it from a prop, for example? So I could force useEffect when rendering it through React.renderToStaticMarkup even though I'm on the client side.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I might be "pushing the limits" of react-table with this, but I want to be able to export it into PDF (in an electron app). My approach so far consists of rendering the table with a
React.renderToStaticMarkup
as I don't need to put it in the DOM. With the resulting html I'm opening a new invisible BrowserWindow (electron) where I can then print it to PDF.The problem:
React.renderToStaticMarkup
, normally used on SSR, doesn't likeuseLayoutEffect
and it throws a bunch of warnings if it catches one.react-table
is aware of that by using thesafeUseLayoutEffect
:https://github.com/tannerlinsley/react-table/blob/aa2835766a7a34f70cd6b579628e4f7e820970ab/src/publicUtils.js#L148-L149
But still, would it be possible to control it from a prop, for example? So I could force
useEffect
when rendering it throughReact.renderToStaticMarkup
even though I'm on the client side.Beta Was this translation helpful? Give feedback.
All reactions