Skip to content

Commit ace68b7

Browse files
committed
docs(fix): reset selected vote state
1 parent 70f33b7 commit ace68b7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/app/components/Feedback/Feedback.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ export const Feedback = ({ location }: FeedbackProps) => {
4949
}
5050
}, [])
5151

52+
React.useEffect(() => {
53+
setSelected(null)
54+
/**
55+
* if the location changes, reset the selected state
56+
* otherwise you vote once somewhere and can never do it again
57+
*/
58+
}, [location])
59+
5260
return (
5361
<div>
5462
<Heading

0 commit comments

Comments
 (0)