Commit 7872d2f
committed
fix: Skip function properties during diff comparison
When comparing VNode properties during diff, we were trying to compare
function values directly (renderUpdate callback). Functions aren't
comparable in Go, causing a panic:
'comparing uncomparable type func(float64, interface {})'
**Fix:**
- Added isFunction() helper to detect function properties
- Modified propsChanged() to skip function properties during comparison
- Only count and compare non-function properties
**Related:**
- dom.go already skips functions when setting DOM attributes
- eventsChanged() already handles non-comparable event handlers similarly
This allows GPURenderUpdate and other function callbacks to work correctly
without causing panics during re-renders.1 parent 76953ba commit 7872d2f
1 file changed
Lines changed: 33 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
313 | 327 | | |
314 | 328 | | |
315 | 329 | | |
316 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
317 | 336 | | |
318 | 337 | | |
319 | 338 | | |
| |||
322 | 341 | | |
323 | 342 | | |
324 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
325 | 357 | | |
326 | 358 | | |
327 | 359 | | |
| |||
0 commit comments