You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/backend/controllers/createTree.ts
+37-2Lines changed: 37 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -152,12 +152,47 @@ export default function createTree(currentFiberNode: Fiber): Tree {
152
152
}
153
153
}
154
154
155
-
155
+
// COMMENT OUT SINCE EXTRACTING CONTEXT IS STILL IN EXPERIMENT
156
+
// // ------------APPEND CONTEXT DATA FROM REACT DEV TOOL----------------
157
+
// // memoizedState
158
+
// // Note: if user use ReactHook, memoizedState.memoizedState can be a falsy value such as null, false, ... => need to specify this data is not undefined
159
+
// if (
160
+
// (tag === FunctionComponent || tag === ClassComponent || tag === IndeterminateComponent) &&
161
+
// memoizedState?.memoizedState !== undefined
162
+
// ) {
163
+
// // If user uses Redux, context data will be stored in memoizedState of the Provider component => grab context object stored in the memoizedState
// // if user uses useContext hook, context data will be stored in memoizedProps.value of the Context.Provider component => grab context object stored in memoizedprops
179
+
// // Different from other provider, such as Routes, BrowserRouter, ReactRedux, ..., Context.Provider does not have a displayName
180
+
// // TODO: need to render this context provider when user use useContext hook.
181
+
//
182
+
//
183
+
// if (tag === ContextProvider && !elementType._context.displayName) {
// ---------OBTAIN STATE & SET STATE METHODS FROM CLASS COMPONENT-----------
158
193
// Check if currentFiberNode is a stateful class component when user use setState.
159
194
// If user use setState to define/manage state, the state object will be stored in stateNode.state => grab the state object stored in the stateNode.state
160
-
// Example: for tic-tac-toe demo-app: Board is a stateful component that use setState to store state data.
195
+
// Example: for tic-tac-toe demo-app: Board is a stateful component that use setState to store stat
// Save component's state and setState() function to our record for future time-travel state changing. Add record index to snapshot so we can retrieve.
0 commit comments