Skip to content

Commit c3e73b4

Browse files
authored
fix: add getInitData api (#6707)
1 parent a7a4573 commit c3e73b4

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changeset/afraid-walls-do.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@modern-js/runtime': patch
3+
---
4+
5+
fix: add missing getInitData api
6+
fix: 添加缺失的 getInitData 接口

packages/runtime/plugin-runtime/src/core/compatible.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ export const useRuntimeContext = () => {
234234
request: baseSSRContext.request || ({} as TSSRContext['request']),
235235
response: baseSSRContext.response || ({} as TSSRContext['response']),
236236
logger: baseSSRContext.logger || ({} as TSSRContext['logger']),
237+
getInitData: () => {
238+
return Object.freeze(context.initialData);
239+
},
237240
}
238241
: ({} as TSSRContext);
239242

0 commit comments

Comments
 (0)