Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yiescc opened this issue Apr 18, 2022 · 1 comment
Open

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

yiescc opened this issue Apr 18, 2022 · 1 comment

Comments

@yiescc
Copy link

yiescc commented Apr 18, 2022

背景:

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

示例demo:

  const value = undefined;

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

表现:

  • 原生react报错如下

image

- 在raxzho中,没有报错
@SoloJiang
Copy link
Collaborator

我来看下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants