File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,25 @@ options.unmount = vnode => {
133
133
}
134
134
} ;
135
135
136
+ /**
137
+ *
138
+ * @returns {import('./internal').HookState }
139
+ */
140
+ function createHookState ( ) {
141
+ return {
142
+ _value : undefined ,
143
+ _nextValue : undefined ,
144
+ _pendingValue : undefined ,
145
+ _args : undefined ,
146
+ _pendingArgs : undefined ,
147
+ _component : undefined ,
148
+ _cleanup : undefined ,
149
+ _context : undefined ,
150
+ _factory : undefined ,
151
+ _reducer : undefined
152
+ } ;
153
+ }
154
+
136
155
/**
137
156
* Get a hook's state from the currentComponent
138
157
* @param {number } index The index of the hook to get
@@ -158,7 +177,7 @@ function getHookState(index, type) {
158
177
} ) ;
159
178
160
179
if ( index >= hooks . _list . length ) {
161
- hooks . _list . push ( { } ) ;
180
+ hooks . _list . push ( createHookState ( ) ) ;
162
181
}
163
182
164
183
return hooks . _list [ index ] ;
You can’t perform that action at this time.
0 commit comments