You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/web/content/docs/getting-started/server-components.mdx
+5-5
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ RSCs can help reduce the size of the client-side JavaScript bundle and improve l
9
9
10
10
## Usage
11
11
12
-
Without `'use client'` directive:
12
+
Without `"use client"` directive:
13
13
14
14
```jsx
15
15
import { Button } from"flowbite-react";
@@ -19,7 +19,7 @@ function Component() {
19
19
}
20
20
```
21
21
22
-
With `'use client'` directive:
22
+
With `"use client"` directive:
23
23
24
24
```jsx
25
25
"use client";
@@ -31,7 +31,7 @@ function Component() {
31
31
}
32
32
```
33
33
34
-
Incorrect: without `'use client'` directive and user event passed as prop (`onClick`) resulting in error:
34
+
Incorrect: without `"use client"` directive and user event passed as prop (`onClick`) resulting in error:
35
35
36
36
```jsx
37
37
// errors
@@ -85,7 +85,7 @@ function Component() {
85
85
86
86
## Support
87
87
88
-
All Flowbite React components are server-ready, meaning they can be rendered inside React Server Components without the need of `'use client'` directive at the top of the file.
88
+
All Flowbite React components are server-ready, meaning they can be rendered inside React Server Components without the need of `"use client"` directive at the top of the file.
89
89
90
90
Here's a list of all Flowbite React components that are fully rendered on the server:
91
91
@@ -95,6 +95,6 @@ Here's a list of all Flowbite React components that are fully rendered on the se
95
95
96
96
User event props (such as `onClick`, `onBlur`, ...etc) DO NOT work in React Server Components.
97
97
98
-
To pass any user events to a Flowbite React component (such as `onClick`, `onBlur`) the parent component must have the `'use client'` directive.
98
+
To pass any user events to a Flowbite React component (such as `onClick`, `onBlur`) the parent component must have the `"use client"` directive.
99
99
100
100
Only serializable data can be passed to a server component as props (eg: functions will not work).
0 commit comments