Commit dade03e
committed
fix: add SSR guard to MethodEndpoint for React 19 compatibility
During server-side rendering with React 19 and react-redux v7.x,
the Redux context is not properly propagated, causing useSelector
to fail with 'Cannot read properties of null (reading store)'.
This fix adds an ExecutionEnvironment check to render a static
version of the component during SSR, avoiding the Redux store
access entirely. The full interactive version still renders
on the client side.
Fixes #1130 (partial - addresses SSR build failures)1 parent 2e26316 commit dade03e
File tree
1 file changed
+22
-0
lines changed- packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/MethodEndpoint
1 file changed
+22
-0
lines changedLines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
41 | 63 | | |
42 | 64 | | |
43 | 65 | | |
| |||
0 commit comments