Signature
Returns
Returns a
Map containing all context key-value pairs from the parent component.Example
Programmatic Component Creation
Parent Component Setting Multiple Contexts
Dynamic Component Using Contexts
Portal/Teleport Pattern
Context Cloning Pattern
Notes
- Must be called during component initialisation (not in callbacks or effects)
- Returns a
Mapobject containing all context entries from parent components - Primarily useful for programmatic component creation with
mount() - The returned map includes all contexts from the component tree above the current component
- Modifying the returned map does not affect the parent’s context