@@ -110,9 +110,9 @@ const DiffSplitViewTable = (props: { side: SplitSide; diffFile: DiffFile; onSele
110110export const DiffSplitViewNormal = ( props : { diffFile : DiffFile } ) => {
111111 const isMounted = useIsMounted ( ) ;
112112
113- let ref1 = null as HTMLDivElement | null ;
113+ const [ ref1 , setRef1 ] = createSignal < HTMLDivElement | null > ( null ) ;
114114
115- let ref2 = null as HTMLDivElement | null ;
115+ const [ ref2 , setRef2 ] = createSignal < HTMLDivElement | null > ( null ) ;
116116
117117 const [ side , setSide ] = createSignal < SplitSide | undefined > ( undefined ) ;
118118
@@ -128,8 +128,8 @@ export const DiffSplitViewNormal = (props: { diffFile: DiffFile }) => {
128128
129129 const initSyncScroll = ( ) => {
130130 if ( ! isMounted ( ) ) return ;
131- const left = ref1 ;
132- const right = ref2 ;
131+ const left = ref1 ( ) ;
132+ const right = ref2 ( ) ;
133133 if ( ! left || ! right ) return ;
134134 const clean = syncScroll ( left , right ) ;
135135 onCleanup ( clean ) ;
@@ -156,7 +156,7 @@ export const DiffSplitViewNormal = (props: { diffFile: DiffFile }) => {
156156 </ style >
157157 < div
158158 class = "old-diff-table-wrapper diff-table-scroll-container w-full overflow-x-auto overflow-y-hidden"
159- ref = { ( l ) => ( ref1 = l ) }
159+ ref = { ( l ) => setRef1 ( l ) }
160160 style = { {
161161 [ diffAsideWidthName ] : `${ Math . round ( computedWidth ( ) ) } px` ,
162162 "overscroll-behavior-x" : "none" ,
@@ -169,7 +169,7 @@ export const DiffSplitViewNormal = (props: { diffFile: DiffFile }) => {
169169 < div class = "diff-split-line w-[1.5px]" style = { { "background-color" : `var(${ borderColorName } )` } } />
170170 < div
171171 class = "new-diff-table-wrapper diff-table-scroll-container w-full overflow-x-auto overflow-y-hidden"
172- ref = { ( l ) => ( ref2 = l ) }
172+ ref = { ( l ) => setRef2 ( l ) }
173173 style = { {
174174 [ diffAsideWidthName ] : `${ Math . round ( computedWidth ( ) ) } px` ,
175175 "overscroll-behavior-x" : "none" ,
0 commit comments