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
@CoNF1G - I am checking if this is possible. Will see if we can achieve this
Yes, you can. But you might have to check when you go to embedded component is it coming at right position or not
Okay.. when you say right position doesn't it mean absolute positioning?
@utsav.kapoor thanks, let me know if it is possible
Doesn't looks like it is possible as we are creating this component outside react DOM.
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
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
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
@CoNF1G can you share some code snippets of the same ?
I have shared the replit invite with you
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;
}
Thanks @Justin Mathew