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

JSX 条件语句中错误的方式导致组件未重新挂载(涉及组件diff原理) #19

Open
BUPTlhuanyu opened this issue Jan 26, 2022 · 0 comments

Comments

@BUPTlhuanyu
Copy link
Owner

https://thoughtspile.github.io/2022/01/17/jsx-conditionals/

{condition ? : } will not remount Tag — use unique key or separate && branches if you want the remount.

Diff 原理:https://juejin.cn/post/6844903973585944589
先比较组件type,再比较 key,之后比较位置 index

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

1 participant