@@ -32,6 +32,7 @@ type Props = {
3232 ((prev: { scrollPosition: number } | undefined) => { scrollPosition: number })
3333 ) => void;
3434 resetState: () => void;
35+ info: unknown; // Ephemeral navigation info
3536};` } </ CodeBlock >
3637 </ article >
3738
@@ -58,6 +59,7 @@ type Props = {
5859 state: { selectedTab: string } | undefined;
5960 setState: (state: ...) => void;
6061 resetState: () => void;
62+ info: unknown; // Ephemeral navigation info
6163};` } </ CodeBlock >
6264 </ article >
6365
@@ -86,11 +88,11 @@ type MyParams = PathParams<"/users/:userId">;
8688 When using the < code > route()</ code > or < code > routeState()</ code > { " " }
8789 helper, component types are inferred automatically. Components always
8890 receive < code > params</ code > , < code > state</ code > , < code > setState</ code >
89- , and < code > resetState</ code > props , and receive a < code > data </ code > { " " }
90- prop when a loader is defined.
91+ , < code > resetState</ code > , and < code > info </ code > props, and receive a { " " }
92+ < code > data </ code > prop when a loader is defined.
9193 </ p >
92- < CodeBlock language = "tsx" > { `// With loader: component receives { data, params, state, setState, resetState }
93- // Without loader: component receives { params, state, setState, resetState }
94+ < CodeBlock language = "tsx" > { `// With loader: component receives { data, params, state, setState, resetState, info }
95+ // Without loader: component receives { params, state, setState, resetState, info }
9496
9597// Example without state type:
9698route({
@@ -135,7 +137,13 @@ routeState<{ tab: string }>()({
135137 < CodeBlock language = "typescript" > { `interface NavigateOptions {
136138 replace?: boolean;
137139 state?: unknown;
140+ info?: unknown; // Ephemeral, not persisted in history
138141}` } </ CodeBlock >
142+ < p >
143+ < strong > Note:</ strong > < code > state</ code > is persisted in history and
144+ available across back/forward navigation. < code > info</ code > is
145+ ephemeral and only available during the navigation that triggered it.
146+ </ p >
139147 </ article >
140148 </ div >
141149 ) ;
0 commit comments