Skip to content

react-shiki@0.11.3

Latest

Choose a tag to compare

@github-actions github-actions released this 13 Nov 05:43
48f7f61

Patch Changes

  • Feat: add a cache option. Pass a Map and highlighted output is kept across unmounts, so remounting unchanged code (switching chat threads, virtualized lists) paints on the first render without highlighting again. Output is stored on unmount, so partial code from streaming never lands in the cache, and entries are keyed by code, language, theme and options. #208 161cb25 @AVGVSTVS96

     const cache = new Map();
     
     <ShikiHighlighter language="tsx" theme="github-dark" cache={cache}>
       {code}
     </ShikiHighlighter>;