Skip to main content

useNodeSorter()

function useNodeSorter(): (a: UiNode, b: UiNode, ctx: {
flowType: string;
}) => number;

The useNodeSorter hook provides a way to access the node sorting function

The node sorting function is used to determine the order of nodes in a flow based on their attributes and context.

To customize the sorting behavior, you can provide a custom nodeSorter function to the OryComponentProvider.

Returns

a function that sorts nodes based on the provided context.

(
a: UiNode,
b: UiNode,
ctx: {
flowType: string;
}): number;

Parameters

ParameterType
aUiNode
bUiNode
ctx{ flowType: string; }
ctx.flowTypestring

Returns

number