Skip to content

Commit f5d4596

Browse files
authored
fix DocsRating violating rules of hooks (#4720)
1 parent 5dc36e3 commit f5d4596

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

website/core/DocsRating.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ import useIsBrowser from '@docusaurus/useIsBrowser';
1010

1111
const DocsRating = ({label}) => {
1212
const isBrowser = useIsBrowser();
13+
const [haveVoted, setHaveVoted] = useState(false);
14+
1315
if (!isBrowser) {
1416
return null;
1517
}
1618

17-
const [haveVoted, setHaveVoted] = useState(false);
1819
const giveFeedback = value => {
1920
if (window.ga) {
2021
window.ga('send', {

0 commit comments

Comments
 (0)