alibaba / alibaba/rax

[Question] useEffect里面的代码不会报错

Open
#2,347 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
8k
Forks
611
PR merge metrics
No merged PRs in 30d

Description

背景:
- useEffect里面执行的代码不会报错,会直接中断代码,需要自己try catch捕获错误

示例demo:
```
const value = undefined;

useEffect(() => {
const a = value[0];
}, [value]);
```

表现:
- 原生react报错如下
image
- 在raxzho中,没有报错

Contributor guide

Open the contributing guide

Research direction

Start with the supplied JavaScript reproduction and compare its behavior in native React with raxzho. No repository file or test is named, so trace the useEffect entry point and determine why the exception is not reported; done means the behavior is explained and a regression check captures the expected error handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.