Skip to content

Commit

Permalink
fix(presentation): remove shared state value removal on unmount (#2135)
Browse files Browse the repository at this point in the history
  • Loading branch information
rdunk authored Nov 11, 2024
1 parent 4e4bcc7 commit b246aa0
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/presentation/src/overlays/useSharedState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,11 @@ export const useSharedState = (key: string, value: Serializable): undefined => {
throw new Error('Preview Snapshots context is missing')
}

const {removeValue, setValue} = context
const {setValue} = context

useEffect(() => {
setValue(key, value)
}, [key, value, setValue])

useEffect(() => {
return () => {
removeValue(key)
}
}, [key, removeValue])

return undefined
}

0 comments on commit b246aa0

Please sign in to comment.