Skip to content

Commit ee6972d

Browse files
committed
fixed undefined bug
1 parent e86d568 commit ee6972d

File tree

2 files changed

+215
-216
lines changed

2 files changed

+215
-216
lines changed

src/backend/linkFiber.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ function createTree(
202202
// check to see if we can get the information we were looking for
203203
if (tag === 5) {
204204
try {
205-
if (memoizedProps.children[0]._owner?.memoizedProps !== undefined) {
205+
if (memoizedProps.children && memoizedProps.children[0]?._owner?.memoizedProps !== undefined) {
206206
const propsData = memoizedProps.children[0]._owner.memoizedProps;
207207
const newPropData = convertDataToString(propsData, tree.componentData.props ? tree.componentData.props : null);
208208
tree.componentData = {
@@ -237,7 +237,6 @@ function createTree(
237237
// if the component uses the useContext hook, we want to grab the co text object and add it to the componentData object for that fiber
238238
if (tag === 0 && _debugHookTypes) {
239239
componentData.context = convertDataToString(dependencies?.firstContext?.memoizedValue, null);
240-
console.log(convertDataToString(componentData.context, null), componentData.context);
241240
}
242241
// Check if node is a stateful class component
243242
if (stateNode && stateNode.state && (tag === 0 || tag === 1 || tag === 2)) {

0 commit comments

Comments
 (0)