Skip to content

Commit

Permalink
docs(fix): reset selected vote state
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaellis committed Dec 8, 2022
1 parent 70f33b7 commit ace68b7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/app/components/Feedback/Feedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ export const Feedback = ({ location }: FeedbackProps) => {
}
}, [])

React.useEffect(() => {
setSelected(null)
/**
* if the location changes, reset the selected state
* otherwise you vote once somewhere and can never do it again
*/
}, [location])

return (
<div>
<Heading
Expand Down

0 comments on commit ace68b7

Please sign in to comment.