From dae0c4fe4bbb5d2dcbf38d54c8bc31f6c68b0c01 Mon Sep 17 00:00:00 2001 From: wuwenlong <773314621@qq.com> Date: Mon, 5 Jan 2026 17:19:02 +0800 Subject: [PATCH] fix: StableBlock responds to theme changes --- packages/streamdown-rn/src/renderers/StableBlock.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/streamdown-rn/src/renderers/StableBlock.tsx b/packages/streamdown-rn/src/renderers/StableBlock.tsx index 517496f..0f4a078 100644 --- a/packages/streamdown-rn/src/renderers/StableBlock.tsx +++ b/packages/streamdown-rn/src/renderers/StableBlock.tsx @@ -49,8 +49,10 @@ export const StableBlock: React.FC = React.memo( console.warn('StableBlock has no AST:', block.type, block.id); return null; }, - // Only re-render if the block's content hash changes (which shouldn't happen for stable blocks) - (prev, next) => prev.block.contentHash === next.block.contentHash + // Re-render if block content or theme changes + (prev, next) => + prev.block.contentHash === next.block.contentHash && + prev.theme === next.theme ); StableBlock.displayName = 'StableBlock';