Skip to content

Commit 33bd2e7

Browse files
authored
fix: StableBlock responds to theme changes (#19)
1 parent f0454d0 commit 33bd2e7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/streamdown-rn/src/renderers/StableBlock.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ export const StableBlock: React.FC<StableBlockProps> = React.memo(
4949
console.warn('StableBlock has no AST:', block.type, block.id);
5050
return null;
5151
},
52-
// Only re-render if the block's content hash changes (which shouldn't happen for stable blocks)
53-
(prev, next) => prev.block.contentHash === next.block.contentHash
52+
// Re-render if block content or theme changes
53+
(prev, next) =>
54+
prev.block.contentHash === next.block.contentHash &&
55+
prev.theme === next.theme
5456
);
5557

5658
StableBlock.displayName = 'StableBlock';

0 commit comments

Comments
 (0)