mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-21 17:18:52 +00:00
Fix type for passthrough props
This commit is contained in:
parent
99876bb105
commit
1ddd2c0bf6
1 changed files with 2 additions and 11 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import React from "react";
|
||||
import deburr from "lodash/deburr";
|
||||
|
||||
interface Props {
|
||||
interface Props extends React.HTMLAttributes<HTMLSpanElement> {
|
||||
children: string | number;
|
||||
className?: string;
|
||||
}
|
||||
|
|
@ -11,16 +11,7 @@ export const characterClassName = (char: string | number) =>
|
|||
.toLowerCase()
|
||||
.charCodeAt(0)}`;
|
||||
|
||||
const Character = ({
|
||||
children: char,
|
||||
className,
|
||||
...passThrough
|
||||
}: Props &
|
||||
// TODO: Seems like there should be a better way to do pass through props
|
||||
React.DetailedHTMLProps<
|
||||
React.HTMLAttributes<HTMLSpanElement>,
|
||||
HTMLSpanElement
|
||||
>) => (
|
||||
const Character = ({ children: char, className, ...passThrough }: Props) => (
|
||||
<span
|
||||
{...passThrough}
|
||||
className={`${className || ""} character ${characterClassName(char)}`}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue