Skip to content

Commit

Permalink
lib/useId - regenerate ID if vNode's index changes
Browse files Browse the repository at this point in the history
  • Loading branch information
LankyMoose committed Sep 29, 2024
1 parent c146954 commit 280fa85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/lib/src/hooks/useId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const createUseIdState = (): UseIdState => ({
})

const useIdCallback: HookCallback<UseIdState> = ({ hook, isInit, vNode }) => {
if (isInit) {
if (isInit || vNode.index !== hook.idx) {
hook.idx = vNode.index
const accumulator: number[] = []
let n: Kaioken.VNode | undefined = vNode
Expand Down

0 comments on commit 280fa85

Please sign in to comment.