Commit f306229
committed
fix: force PageTitleInput reset on wiki URL change
Add key={wikiUrl.href} to PageTitleInput to force React to unmount
and remount the component when the wiki site changes. This fixes three
issues:
1. pageTitle state - now resets to searchState.pageTitle
2. debouncedTitle - debounce timer is cleared and restarted
3. ErrorBoundary - stale errors from the old wiki are cleared
The key prop is React's documented pattern for "resetting all state
when a prop changes" and requires no changes inside PageTitleInput.
Co-Authored-By: Claude1 parent 10b88a9 commit f306229
1 file changed
+31
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
328 | 329 | | |
329 | 330 | | |
330 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
331 | 362 | | |
332 | 363 | | |
333 | 364 | | |
| |||
0 commit comments