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

fix: resolve old fiber update caused by closure capture #382

Merged
merged 1 commit into from
Mar 12, 2025

Conversation

wooloo26
Copy link
Contributor

No description provided.

@yisar
Copy link
Collaborator

yisar commented Mar 12, 2025

你改哪儿啦,俺肿么看不出来

@wooloo26
Copy link
Contributor Author

你改哪儿啦,俺肿么看不出来

if (hook.length === 0) 里的逻辑只会应用最早的fiber,而之后每次运行的函数应该对应新的fiber,就是那个update(current),你打个唯一id给fiber,dispatch永远调的是最早的那个fiber

@yisar
Copy link
Collaborator

yisar commented Mar 12, 2025

这里照理说调用的就是 old fiber,但是具体为啥要这样,我给忘了当时是为了啥了,我给合并了吧,之后有问题再说

@yisar yisar merged commit a2235c9 into frejs:master Mar 12, 2025
1 check passed
@wooloo26
Copy link
Contributor Author

这里照理说调用的就是 old fiber,但是具体为啥要这样,我给忘了当时是为了啥了,我给合并了吧,之后有问题再说

主要是我写示例写出bug了,props更新后这个old fiber还取的旧props

@yisar
Copy link
Collaborator

yisar commented Mar 12, 2025

okk,好嘞,问题不大

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

Successfully merging this pull request may close these issues.

2 participants