Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
amrocha committed Sep 20, 2019
1 parent c64e87a commit b363280
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/components/DatePicker/components/Day/Day.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface DayProps {
disabled?: boolean;
onClick?(day: Date): void;
onHover?(day?: Date): void;
onFocus?(day?: Date): void;
onFocus?(day: Date): void;
}

export function Day({
Expand All @@ -31,14 +31,11 @@ export function Day({
const i18n = useI18n();
const dayNode = useRef<HTMLButtonElement>(null);

useEffect(
() => {
if (focused && dayNode.current) {
dayNode.current.focus();
}
},
[focused],
);
useEffect(() => {
if (focused && dayNode.current) {
dayNode.current.focus();
}
}, [focused]);

if (!day) {
return <div className={styles.EmptyDay} onMouseOver={() => onHover(day)} />;
Expand Down

0 comments on commit b363280

Please sign in to comment.