File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
packages/react-router/lib Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " react-router " : patch
3+ ---
4+
5+ update <Await > to accept ReactNode as children function return result
Original file line number Diff line number Diff line change @@ -394,7 +394,7 @@ export function Routes({
394394}
395395
396396export interface AwaitResolveRenderFunction {
397- ( data : Awaited < any > ) : React . ReactElement ;
397+ ( data : Awaited < any > ) : React . ReactNode ;
398398}
399399
400400export interface AwaitProps {
@@ -531,10 +531,8 @@ function ResolveAwait({
531531 children : React . ReactNode | AwaitResolveRenderFunction ;
532532} ) {
533533 let data = useAsyncValue ( ) ;
534- if ( typeof children === "function" ) {
535- return children ( data ) ;
536- }
537- return < > { children } </ > ;
534+ let toRender = typeof children === "function" ? children ( data ) : children ;
535+ return < > { toRender } </ > ;
538536}
539537
540538///////////////////////////////////////////////////////////////////////////////
You can’t perform that action at this time.
0 commit comments