react-bounds icon indicating copy to clipboard operation
react-bounds copied to clipboard

Components render empty in Server Side Rendering

Open marcato15 opened this issue 6 years ago • 2 comments

Is there any support for SSR? I noticed that when my server renders out components that are wrapped in a react-bounds component, that none of the html gets render on the Server Side generated code. Is that a known issue of this method?

marcato15 avatar Oct 15 '17 13:10 marcato15

Since this isn't supported, the workaround I came up with was when I'm returning a wrapped component, I check if I'm in the client or the server.

const ResponsiveBackgroundImage = typeof window !== "undefined" ?
    widthProvider(BackgroundImage) :
    BackgroundImage;

marcato15 avatar Oct 15 '17 13:10 marcato15

@casesandberg Wondering if this is on the radar to be supported? Thank you for putting out this library!

oyeanuj avatar Nov 11 '17 19:11 oyeanuj