Skip to content

Commit

Permalink
improve error log
Browse files Browse the repository at this point in the history
  • Loading branch information
MrWangJustToDo committed Nov 10, 2023
1 parent 8f44ef6 commit 8bf1bc6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions __tests__/testHook.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
<script src="../bundle/babel.min.js"></script>
<!-- <script src="../bundle/react.development.js"></script> -->
<!-- <script src="../bundle/react-dom.development.js"></script> -->
<script src="../packages/myreact/dist/umd/index.development.js"></script>
<script src="../packages/myreact-dom/dist/umd/index.development.js"></script>
<!-- <script src="../packages/myreact/dist/umd/index.development.js"></script> -->
<!-- <script src="../packages/myreact-dom/dist/umd/index.development.js"></script> -->
<script src="../packages/myreact/dist/umd/index.production.js"></script>
<script src="../packages/myreact-dom/dist/umd/index.production.js"></script>
<!-- <script src="../packages/myreact-dom/dist/umd/index.development.js"></script> -->
<style>
.red {
color: red;
Expand Down Expand Up @@ -118,6 +121,8 @@

console.log(val);

val % 2 === 0 ? useState() : useRef();

return (
<div>
<Counter initialCount={val} />
Expand Down
2 changes: 2 additions & 0 deletions packages/myreact-reconciler/src/renderUpdate/trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ export const triggerError = (fiber: MyReactFiberNode, error: Error, cb?: () => v

cb?.();

throw error;
} else {
throw error;
}
}
Expand Down

0 comments on commit 8bf1bc6

Please sign in to comment.