FluentUI Compat

Home > @cascadiacollections/fluentui-compat > resetIdCounter

resetIdCounter() function

Reset the global ID counter. Useful for testing.

⚠️ **Warning**: This should only be used in tests. Calling this in production code can lead to duplicate IDs and accessibility issues.

Signature:

export declare function resetIdCounter(counter?: number): void;

Parameters

Parameter

Type

Description

counter

number

(Optional) The value to reset the counter to (default: 0)

Returns:

void

Example

// In a test file
beforeEach(() => {
  resetIdCounter();
});
  • Edit this page
In this article
Back to top FluentUI React complimentary components and utilities focused on render performance