Skip to content

Commit af35d92

Browse files
authored
fix: plugin ID generation to include index when using the plugin name (#51)
If two plugins share the same name, they currently receive the same `id`, which causes both to activate when you click on either one in the sidebar.
1 parent 4c00d9b commit af35d92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/devtools/src/context/devtools-context.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const generatePluginId = (plugin: TanStackDevtoolsPlugin, index: number) => {
8585
}
8686
if (typeof plugin.name === 'string') {
8787
// if name is a string, use it to generate an id
88-
return plugin.name.toLowerCase().replace(' ', '-')
88+
return `${plugin.name.toLowerCase().replace(' ', '-')}-${index}`
8989
}
9090
// Name is JSX? return the index as a string
9191
return index.toString()

0 commit comments

Comments
 (0)