Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
-
0.5
-
Flagged
-
Quasar
-
Puma Sprint 235, Puma Sprint 236, Puma Sprint 237, Puma Sprint 238, Puma Sprint 239
Description
Reported by client:
Currently the @bloomreach/react-sdk BRPage component will only initialise on the client side. The data is fetched on the server, but the HTML will only be generated on the client.
This is because the react lifecycle componentDidMount is used which only runs on the client. When using the componentWillMount lifecycle to initialise the page we could already serve all HTML to our clients and reduce the work needed for clients and potentially improve performance.
Steps to reproduce :
- Install and run https://code.onehippo.org/cms-community/bloomreach-spa-sdk/tree/bloomreach-spa-sdk-14.1.0/examples/react-ssr the React-SSR example.
- View the source of the served page and see an empty <div>.
- Change https://code.onehippo.org/cms-community/bloomreach-spa-sdk/blob/bloomreach-spa-sdk-14.1.0/packages/react-sdk/src/page/BrPage.tsx#L66 to componentWillMount.
View the source of the served page and see the rendered HTML.
Attachments
Issue Links
- is blocked by
-
CMS-13411 Provide a synchronous way to hydrate the Page Model in the SPA SDK
- Closed