From e112e9d5f476e0a214e537c9105cf082af94c0ab Mon Sep 17 00:00:00 2001 From: Oliver Becker Date: Sun, 24 Mar 2024 12:46:23 +0100 Subject: [PATCH] fix: allow any standard HTML attributes as props in the NanoClamp type definition + Fixes https://github.com/microlinkhq/nanoclamp/issues/26 --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 6419e53..29a7637 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ import { createElement, useRef, useEffect, useCallback, useMemo } from 'react' -interface Props { +interface Props extends React.HTMLAttributes { accessibility?: boolean debounce?: number ellipsis?: string @@ -36,7 +36,7 @@ const NanoClamp = ({ lines = 3, text, ...props -}: Props): JSX.Element | null => { +}: Props): React.ReactElement | null => { const elementRef = useRef(null) const textRef = useRef(DEFAULT_TEXT)