You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix FOUC by rendering body first to collect appends, then head with pack tags
Solution:
- Wrap body content in content_for :body_content at TOP of layout
- This executes all react_component calls first, triggering auto-appends
- Then render head with append calls followed by main pack tags
- Finally yield body content
Execution order:
1. content_for :body_content executes (all react_component auto-appends happen)
2. Explicit append_*_pack_tag calls in head
3. stylesheet_pack_tag and javascript_pack_tag in head (with all appends registered)
4. yield :body_content outputs the body
Result: Stylesheets load in head, eliminating FOUC, while preserving
auto_load_bundle functionality.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments