Commit 3d03326
committed
docs: allow sync return from lazy children, add caching contract
Allow the children function to return either synchronously or as a
promise. matchRoutes now calls the function — sync results are
resolved in-place immediately, async results cause a partial match.
This handles the edge case where Router can't commit (state lost):
on re-render, the user's cache returns sync and matchRoutes resolves
it without any suspension. Add caching contract section explaining
the user's responsibility to cache the Promise and resolved result.
Also add Router suspension edge case, updated detailed behavior
flows, and test cases for sync resolution.
https://claude.ai/code/session_01HqWiPByktzUpdesqZbNcHp1 parent 6b02b7f commit 3d03326
1 file changed
+164
-71
lines changed
0 commit comments