Commit af46e91
committed
Fix: Attach custom element event listeners during hydration
- Custom elements with property-based event handlers (e.g., onmy-event) now correctly attach listeners during SSR hydration
- Previously, event handlers were only attached after the first client-side re-render
- hydrateProperties() now re-applies all props for custom elements via setPropOnCustomElement(), mirroring the initial client mount path
- Fixes issue #35446 where custom element events were not firing during hydration in Next.js and other SSR frameworks
- All existing tests pass (167 tests in ReactDOMComponent suite)
This ensures custom element listeners are attached immediately during hydration instead of waiting for a forced re-render workaround.1 parent d6cae44 commit af46e91
1 file changed
Lines changed: 24 additions & 0 deletions
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3210 | 3210 | | |
3211 | 3211 | | |
3212 | 3212 | | |
| 3213 | + | |
| 3214 | + | |
| 3215 | + | |
| 3216 | + | |
| 3217 | + | |
| 3218 | + | |
| 3219 | + | |
| 3220 | + | |
| 3221 | + | |
| 3222 | + | |
| 3223 | + | |
| 3224 | + | |
| 3225 | + | |
| 3226 | + | |
| 3227 | + | |
| 3228 | + | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
| 3234 | + | |
| 3235 | + | |
| 3236 | + | |
3213 | 3237 | | |
3214 | 3238 | | |
3215 | 3239 | | |
| |||
0 commit comments