Skip to content

patchTheme ​

Overview ​

Patch the default theme with a partial theme. Additive merge for object entries; replace semantics when either side is a function (a component-level lazy loader). The loader-replace path supports both registering a loader (patchTheme({ Button: () => import(...) })) and the loader's own self-registration after its chunk resolves (patchTheme({ Button: { ... } }), which overwrites the loader stub with real data).

Signature ​

patchTheme(partialTheme)

Parameters ​

NameTypeRequiredDescription
partialThemeThemeObjectyesThe partial theme to patch the default theme with.

Returns ​

void

Source ​

client/lib/use/themeRegistry.js:205