src/core/packages/chrome/browser-context/README.md
React context and provider for the Chrome service instance.
This package is shipped via kbn-ui-shared-deps-src so all Webpack bundles
share the same React context instance — essential for the provider/consumer
pattern to work across plugin bundle boundaries. It is a private internal
bridge; plugins should use the hooks in @kbn/core-chrome-browser-hooks
instead of importing from here directly.
Core wires this up automatically:
rendering.addContext(element) wraps element in KibanaRootContextProviderKibanaRootContextProvider calls chrome.withProvider(children)chrome.withProvider renders ChromeServiceProvider around childrenAny component rendered via rendering.addContext(...) can therefore use hooks
that call useChromeService() without any additional setup.
ChromeServiceProvider — React provider that injects the chrome instance into the tree.useChromeService — React hook that reads the chrome instance from context.
Throws if called outside of a ChromeServiceProvider.