Hi, is it be possible to prerender

Hi, is it be possible to prerender embedded components in a Next JS app without absolute positioning?
11 Replies
utsav.kapoor
utsav.kapoor7mo ago
@CoNF1G - I am checking if this is possible. Will see if we can achieve this
Aditya
Aditya7mo ago
Yes, you can. But you might have to check when you go to embedded component is it coming at right position or not
CoNF1G
CoNF1GOP7mo ago
Okay.. when you say right position doesn't it mean absolute positioning? @utsav.kapoor thanks, let me know if it is possible
Aditya
Aditya7mo ago
Doesn't looks like it is possible as we are creating this component outside react DOM.
Justin Mathew
Justin Mathew7mo ago
hey @CoNF1G , we also have few new components for PreRender which simplfies the implementation here is an example for the same : https://codesandbox.io/p/sandbox/prerender-demo-mk4q6c
ashish
ashish7mo ago
Prerendered component needs to be attached to the DOM, so however we can hide it from the viewport (with or without absolute positioning). I am assuming you are still trying to render this client side because we do not support SSR
CoNF1G
CoNF1GOP6mo ago
Thanks, I will check it out Update: When I use the pre render id while rendering the liveboard it is not loading the embed... without the pre render id it works fine got it, I was checking both client side and server side options
Justin Mathew
Justin Mathew6mo ago
@CoNF1G can you share some code snippets of the same ?
CoNF1G
CoNF1GOP6mo ago
I have shared the replit invite with you
Justin Mathew
Justin Mathew6mo ago
hey @Surya , saw your code got the issue, in since preRender uses the old iframe, the styles you have provided for iframe is not respected adding this in your css fixed it. [data-testid='tsEmbed'] { width: 100vw; height: 100vh; }
CoNF1G
CoNF1GOP6mo ago
Thanks @Justin Mathew

Did you find this page helpful?