Commit bfb4db4
Fix FOUC by moving stylesheets to head and disabling auto_load_bundle
Problem:
- Stylesheets were loading at bottom of body, causing FOUC with SSR
- Moving stylesheet_pack_tag to head failed because react_component
with auto_load_bundle=true would call append_stylesheet_pack_tag
during rendering, which must come before stylesheet_pack_tag
Solution:
- Set auto_load_bundle = false in react_on_rails config
- Manually specify required packs in layout (stimulus-bundle)
- Move stylesheet_pack_tag to head after append calls
- This ensures styles load before content renders, preventing FOUC
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent ec52aa1 commit bfb4db4
File tree
2 files changed
+2
-2
lines changed- app/views/layouts
- config/initializers
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments