mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
feat(react): React Router Enhancements (#21693)
This commit is contained in:
8
packages/react/src/utils/generateId.ts
Normal file
8
packages/react/src/utils/generateId.ts
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
const ids: { [key: string]: number; } = { main: 0 };
|
||||
|
||||
export const generateId = (type = 'main') => {
|
||||
const id = (ids[type] ?? 0) + 1;
|
||||
ids[type] = id;
|
||||
return (id).toString();
|
||||
};
|
Reference in New Issue
Block a user