renderState() — vue Function Reference
Architecture documentation for the renderState() function in index.ts from the vue codebase.
Entity Profile
Dependency Diagram
graph TD 1788e29c_e4bb_9fb7_3ffa_5decd1d21123["renderState()"] a6b6f41b_6598_1b32_00b3_8bbaa08b8c64["TemplateRenderer"] 1788e29c_e4bb_9fb7_3ffa_5decd1d21123 -->|defined in| a6b6f41b_6598_1b32_00b3_8bbaa08b8c64 c2756fe6_1f1e_29d1_4e0a_75be9f92ec3b["render()"] c2756fe6_1f1e_29d1_4e0a_75be9f92ec3b -->|calls| 1788e29c_e4bb_9fb7_3ffa_5decd1d21123 b826801b_639e_be55_d795_731fd2aa3dc5["_flush()"] b826801b_639e_be55_d795_731fd2aa3dc5 -->|calls| 1788e29c_e4bb_9fb7_3ffa_5decd1d21123 style 1788e29c_e4bb_9fb7_3ffa_5decd1d21123 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/server-renderer/src/template-renderer/index.ts lines 227–241
renderState(
context: Record<string, any>,
options?: Record<string, any>
): string {
const { contextKey = 'state', windowKey = '__INITIAL_STATE__' } =
options || {}
const state = this.serialize(context[contextKey])
const autoRemove = __DEV__
? ''
: ';(function(){var s;(s=document.currentScript||document.scripts[document.scripts.length-1]).parentNode.removeChild(s);}());'
const nonceAttr = context.nonce ? ` nonce="${context.nonce}"` : ''
return context[contextKey]
? `<script${nonceAttr}>window.${windowKey}=${state}${autoRemove}</script>`
: ''
}
Domain
Subdomains
Source
Frequently Asked Questions
What does renderState() do?
renderState() is a function in the vue codebase, defined in packages/server-renderer/src/template-renderer/index.ts.
Where is renderState() defined?
renderState() is defined in packages/server-renderer/src/template-renderer/index.ts at line 227.
What calls renderState()?
renderState() is called by 2 function(s): _flush, render.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free