Fix some react typings

This commit is contained in:
Jordan Eldredge 2019-02-15 07:32:14 -08:00
parent 1ddd2c0bf6
commit ae82938314
3 changed files with 3 additions and 12 deletions

View file

@ -1,20 +1,11 @@
import React, { useState } from "react";
import classnames from "classnames";
type DivProps = React.DetailedHTMLProps<
React.HTMLAttributes<HTMLDivElement>,
HTMLDivElement
>;
interface Props extends DivProps {
interface Props extends React.HTMLAttributes<HTMLDivElement> {
className?: string;
onMouseDown?: (e: React.MouseEvent<HTMLDivElement>) => void;
}
interface State {
clicked: boolean;
}
// Winamp has a strange behavior for the buttons at the top of the main window.
// It shows through to the main background sprite until the first time that it's
// clicked, and then it shows the dedicated undepressed sprite thereafter.

View file

@ -79,7 +79,7 @@ class Marquee extends React.Component<Props, State> {
}
}
handleMouseDown = (e: React.MouseEvent) => {
handleMouseDown = (e: React.MouseEvent<HTMLDivElement>): void => {
const xStart = e.clientX;
this.setState({ stepping: false });
const handleMouseMove = (ee: MouseEvent) => {

View file

@ -14,7 +14,7 @@ interface Props {
}
export default class ResizeTarget extends React.Component<Props> {
handleMouseDown = (e: React.MouseEvent) => {
handleMouseDown = (e: React.MouseEvent<HTMLDivElement>) => {
// Prevent dragging from highlighting text.
e.preventDefault();
const [width, height] = this.props.currentSize;