@@ -74,23 +74,23 @@ const Demo = () => {
7474 < button
7575 type = "button"
7676 onClick = { ( ) => {
77- listRef . current . scrollTo ( null ) ;
77+ listRef . current ? .scrollTo ( null ) ;
7878 } }
7979 >
8080 Show scroll bar
8181 </ button >
8282 < button
8383 type = "button"
8484 onClick = { ( ) => {
85- listRef . current . scrollTo ( 500 ) ;
85+ listRef . current ? .scrollTo ( 500 ) ;
8686 } }
8787 >
8888 Scroll To 100px
8989 </ button >
9090 < button
9191 type = "button"
9292 onClick = { ( ) => {
93- listRef . current . scrollTo ( {
93+ listRef . current ? .scrollTo ( {
9494 index : 99999999 ,
9595 align : 'top' ,
9696 } ) ;
@@ -101,7 +101,7 @@ const Demo = () => {
101101 < button
102102 type = "button"
103103 onClick = { ( ) => {
104- listRef . current . scrollTo ( {
104+ listRef . current ? .scrollTo ( {
105105 index : 50 ,
106106 align : 'top' ,
107107 } ) ;
@@ -112,7 +112,7 @@ const Demo = () => {
112112 < button
113113 type = "button"
114114 onClick = { ( ) => {
115- listRef . current . scrollTo ( {
115+ listRef . current ? .scrollTo ( {
116116 index : 50 ,
117117 align : 'bottom' ,
118118 } ) ;
@@ -123,7 +123,7 @@ const Demo = () => {
123123 < button
124124 type = "button"
125125 onClick = { ( ) => {
126- listRef . current . scrollTo ( {
126+ listRef . current ? .scrollTo ( {
127127 index : 50 ,
128128 align : 'auto' ,
129129 } ) ;
@@ -134,7 +134,7 @@ const Demo = () => {
134134 < button
135135 type = "button"
136136 onClick = { ( ) => {
137- listRef . current . scrollTo ( {
137+ listRef . current ? .scrollTo ( {
138138 index : 50 ,
139139 align : 'top' ,
140140 offset : 15 ,
@@ -146,7 +146,7 @@ const Demo = () => {
146146 < button
147147 type = "button"
148148 onClick = { ( ) => {
149- listRef . current . scrollTo ( {
149+ listRef . current ? .scrollTo ( {
150150 index : 50 ,
151151 align : 'bottom' ,
152152 offset : 15 ,
@@ -158,7 +158,7 @@ const Demo = () => {
158158 < button
159159 type = "button"
160160 onClick = { ( ) => {
161- listRef . current . scrollTo ( {
161+ listRef . current ? .scrollTo ( {
162162 key : 50 ,
163163 align : 'auto' ,
164164 } ) ;
@@ -179,7 +179,7 @@ const Demo = () => {
179179 < button
180180 type = "button"
181181 onClick = { ( ) => {
182- listRef . current . scrollTo ( {
182+ listRef . current ? .scrollTo ( {
183183 index : data . length - 2 ,
184184 align : 'top' ,
185185 } ) ;
@@ -190,7 +190,7 @@ const Demo = () => {
190190 < button
191191 type = "button"
192192 onClick = { ( ) => {
193- listRef . current . scrollTo ( {
193+ listRef . current ? .scrollTo ( {
194194 index : 0 ,
195195 align : 'bottom' ,
196196 } ) ;
@@ -202,7 +202,7 @@ const Demo = () => {
202202 < button
203203 type = "button"
204204 onClick = { ( ) => {
205- listRef . current . scrollTo ( {
205+ listRef . current ? .scrollTo ( {
206206 index : 50 ,
207207 align : 'top' ,
208208 } ) ;
0 commit comments