Skip to content

Commit 2f24f3a

Browse files
git-nandorclaude
andcommitted
docs(ui-top-nav-bar): fix runtime crash in v2 "Full width dialog" example
The in-place search dialog example passed its shared-token override through the `theme` prop, which deep-merges straight into the theme and replaced the `sharedTokens` function with a plain object. When the TextInput computed its style it called `theme.newTheme.sharedTokens?.(semantics)` and threw "theme.newTheme.sharedTokens is not a function". Pass the override via the `themeOverride` prop instead. It is applied separately and deep-merged into the result of `sharedTokens(semantics)`, leaving the function intact. Matches the InstUISettingsProvider JSDoc and the Link v2 README. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7c67546 commit 2f24f3a

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

  • packages/ui-top-nav-bar/src/TopNavBar/v2

packages/ui-top-nav-bar/src/TopNavBar/v2/README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2137,16 +2137,13 @@ class InPlaceDialogExample extends React.Component {
21372137
content: ({ closeInPlaceDialog }) => (
21382138
<View as="div" padding="general.spaceSm">
21392139
<InstUISettingsProvider
2140-
theme={(currentTheme) => ({
2141-
newTheme: {
2142-
sharedTokens: {
2143-
focusOutline: {
2144-
...currentTheme?.newTheme?.sharedTokens?.focusOutline,
2145-
infoColor: 'white'
2146-
}
2140+
themeOverride={{
2141+
sharedTokens: {
2142+
focusOutline: {
2143+
infoColor: 'white'
21472144
}
21482145
}
2149-
})}
2146+
}}
21502147
>
21512148
<TextInput
21522149
id="searchInput"

0 commit comments

Comments
 (0)