@@ -74,23 +74,23 @@ const Demo = () => {
74
74
< button
75
75
type = "button"
76
76
onClick = { ( ) => {
77
- listRef . current . scrollTo ( null ) ;
77
+ listRef . current ? .scrollTo ( null ) ;
78
78
} }
79
79
>
80
80
Show scroll bar
81
81
</ button >
82
82
< button
83
83
type = "button"
84
84
onClick = { ( ) => {
85
- listRef . current . scrollTo ( 500 ) ;
85
+ listRef . current ? .scrollTo ( 500 ) ;
86
86
} }
87
87
>
88
88
Scroll To 100px
89
89
</ button >
90
90
< button
91
91
type = "button"
92
92
onClick = { ( ) => {
93
- listRef . current . scrollTo ( {
93
+ listRef . current ? .scrollTo ( {
94
94
index : 99999999 ,
95
95
align : 'top' ,
96
96
} ) ;
@@ -101,7 +101,7 @@ const Demo = () => {
101
101
< button
102
102
type = "button"
103
103
onClick = { ( ) => {
104
- listRef . current . scrollTo ( {
104
+ listRef . current ? .scrollTo ( {
105
105
index : 50 ,
106
106
align : 'top' ,
107
107
} ) ;
@@ -112,7 +112,7 @@ const Demo = () => {
112
112
< button
113
113
type = "button"
114
114
onClick = { ( ) => {
115
- listRef . current . scrollTo ( {
115
+ listRef . current ? .scrollTo ( {
116
116
index : 50 ,
117
117
align : 'bottom' ,
118
118
} ) ;
@@ -123,7 +123,7 @@ const Demo = () => {
123
123
< button
124
124
type = "button"
125
125
onClick = { ( ) => {
126
- listRef . current . scrollTo ( {
126
+ listRef . current ? .scrollTo ( {
127
127
index : 50 ,
128
128
align : 'auto' ,
129
129
} ) ;
@@ -134,7 +134,7 @@ const Demo = () => {
134
134
< button
135
135
type = "button"
136
136
onClick = { ( ) => {
137
- listRef . current . scrollTo ( {
137
+ listRef . current ? .scrollTo ( {
138
138
index : 50 ,
139
139
align : 'top' ,
140
140
offset : 15 ,
@@ -146,7 +146,7 @@ const Demo = () => {
146
146
< button
147
147
type = "button"
148
148
onClick = { ( ) => {
149
- listRef . current . scrollTo ( {
149
+ listRef . current ? .scrollTo ( {
150
150
index : 50 ,
151
151
align : 'bottom' ,
152
152
offset : 15 ,
@@ -158,7 +158,7 @@ const Demo = () => {
158
158
< button
159
159
type = "button"
160
160
onClick = { ( ) => {
161
- listRef . current . scrollTo ( {
161
+ listRef . current ? .scrollTo ( {
162
162
key : 50 ,
163
163
align : 'auto' ,
164
164
} ) ;
@@ -179,7 +179,7 @@ const Demo = () => {
179
179
< button
180
180
type = "button"
181
181
onClick = { ( ) => {
182
- listRef . current . scrollTo ( {
182
+ listRef . current ? .scrollTo ( {
183
183
index : data . length - 2 ,
184
184
align : 'top' ,
185
185
} ) ;
@@ -190,7 +190,7 @@ const Demo = () => {
190
190
< button
191
191
type = "button"
192
192
onClick = { ( ) => {
193
- listRef . current . scrollTo ( {
193
+ listRef . current ? .scrollTo ( {
194
194
index : 0 ,
195
195
align : 'bottom' ,
196
196
} ) ;
@@ -202,7 +202,7 @@ const Demo = () => {
202
202
< button
203
203
type = "button"
204
204
onClick = { ( ) => {
205
- listRef . current . scrollTo ( {
205
+ listRef . current ? .scrollTo ( {
206
206
index : 50 ,
207
207
align : 'top' ,
208
208
} ) ;
0 commit comments