Skip to content

Commit

Permalink
♻️ Type React.SyntheticEvent (generic for events) on event handlers
Browse files Browse the repository at this point in the history
Cleared lint warnings
  • Loading branch information
pomfrida committed Oct 30, 2020
1 parent 1dd331c commit 2f13712
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/storybook-react/stories/Popover.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { MouseEvent } from 'react'
import React from 'react'
import styled from 'styled-components'
import {
Typography,
Expand Down Expand Up @@ -83,7 +83,7 @@ export const Default: Story<PopoverProps> = (args) => {
export const Placements: Story<PopoverProps> = () => {
const [active, setActive] = React.useState(null)

const handleClick = (event: MouseEvent) => {
const handleClick = (event: React.SyntheticEvent) => {
setActive(event.currentTarget.id)
}

Expand Down Expand Up @@ -271,11 +271,11 @@ export const Placements: Story<PopoverProps> = () => {
export const ActivationTypes: Story<PopoverProps> = () => {
const [active, setActive] = React.useState(null)

const handleClick = (event) => {
const handleClick = (event: React.SyntheticEvent) => {
setActive(event.currentTarget.id)
}

const handleHover = (event: MouseEvent) => {
const handleHover = (event: React.SyntheticEvent) => {
const current = event.currentTarget.id
setTimeout(() => {
setActive(current)
Expand Down

0 comments on commit 2f13712

Please sign in to comment.