- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.5k
refactor(Image): placeholder snapshot can be hydrated #6910
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
base: master
Are you sure you want to change the base?
refactor(Image): placeholder snapshot can be hydrated #6910
Conversation
| Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (2)
 CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including  You can disable this status message by setting the  📝 WalkthroughWalkthrough本次更改调整了  Changes
 Poem
 ✨ Finishing Touches🧪 Generate unit tests
 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit: 
 SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
 Other keywords and placeholders
 CodeRabbit Configuration File ( | 
| commit:  | 
| return ( | ||
| <> | ||
| {!loaded && props.placeholder} | ||
| {props.placeholder && ( | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样每个图片都会多一个 div,感觉不太好
| Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@            Coverage Diff             @@
##           master    #6910      +/-   ##
==========================================
- Coverage   92.80%   92.79%   -0.02%     
==========================================
  Files         336      336              
  Lines        7246     7248       +2     
  Branches     1786     1825      +39     
==========================================
+ Hits         6725     6726       +1     
- Misses        513      514       +1     
  Partials        8        8              ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
 | 

Image 组件的 placeholder 不做条件式渲染,和 img 一样通过
display来控制,使得 Image DOM 快照恢复并水合时不会失败失败原因是快照时的 placeholder 不一定存在(比如图片已经加载好了)但后续水合时一定存在(因为初始态就是
loaded: false)Summary by CodeRabbit