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 => {
133133 }
134134} ;
135135
136+ /**
137+ *
138+ * @returns {import('./internal').HookState }
139+ */
140+ function createHookState ( type ) {
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+
136155/**
137156 * Get a hook's state from the currentComponent
138157 * @param {number } index The index of the hook to get
@@ -158,7 +177,7 @@ function getHookState(index, type) {
158177 } ) ;
159178
160179 if ( index >= hooks . _list . length ) {
161- hooks . _list . push ( { } ) ;
180+ hooks . _list . push ( createHookState ( ) ) ;
162181 }
163182
164183 return hooks . _list [ index ] ;
You can’t perform that action at this time.
0 commit comments