Skip to content

Commit

Permalink
fix: allow any standard HTML attributes as props in the NanoClamp typ…
Browse files Browse the repository at this point in the history
…e definition

+ Fixes #26
  • Loading branch information
obecker committed Mar 24, 2024
1 parent 4f6fe2a commit e112e9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createElement, useRef, useEffect, useCallback, useMemo } from 'react'

interface Props {
interface Props extends React.HTMLAttributes<HTMLElement> {
accessibility?: boolean
debounce?: number
ellipsis?: string
Expand Down Expand Up @@ -36,7 +36,7 @@ const NanoClamp = ({
lines = 3,
text,
...props
}: Props): JSX.Element | null => {
}: Props): React.ReactElement | null => {
const elementRef = useRef<HTMLElement>(null)
const textRef = useRef<string>(DEFAULT_TEXT)

Expand Down

0 comments on commit e112e9d

Please sign in to comment.