Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions docs/knowledge-base/ServerSideRendering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@ We have templates available for both the pages and the app router.

In case you already have an existing Next.js project and want to add UI5 Web Components for React to it, you first need to follow our [general Getting Started Guide](?path=/docs/getting-started--docs#add-ui5webcomponents-react-to-an-existing-app).

For a better SSR support, we recommend importing our stylesheet bundle inside the `_app` file or the root layout (depending on whether you are using the pages or the app router) and set the `staticCssInjected` prop on our `ThemeProvider`:
For better SSR support (i.a. to prevent flickering), we recommend importing our stylesheet bundle inside the `_app` file or the root layout (depending on whether you are using the pages or the app router) and set the `staticCssInjected` prop on our `ThemeProvider`:

**Note:** Only import the stylesheets of the packages you are actually using.

```tsx
import '@ui5/webcomponents-react/styles.css';
import '@ui5/webcomponents-react/styles.css'; // main package styles
// Required only when using the corresponding package
import '@ui5/webcomponents-react-charts/styles.css'; // chart package styles
import '@ui5/webcomponents-react-compat/styles.css'; // compat package styles


export default function AppOrRootLayout() {
// ...
Expand Down
8 changes: 8 additions & 0 deletions packages/charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ To use this library with React 19 you have to override your `react-is` version t
},
```

## Static CSS

If you’ve enabled `staticCSSInjected` on the `ThemeProvider` component ([learn more here](https://sap.github.io/ui5-webcomponents-react/v2/?path=/docs/knowledge-base-server-side-rendering--docs#add-to-existing-project)), make sure to also import the `charts` stylesheet. Otherwise, charts won’t be rendered correctly.

```ts
import '@ui5/webcomponents-react-charts/styles.css';
```

## Documentation

You can find an interactive documentation in our [Storybook](https://sap.github.io/ui5-webcomponents-react/).
Expand Down
Loading