Skip to content

Commit

Permalink
fix: fix shortenTextAfterLength props issue #52
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jul 14, 2024
1 parent d6592fb commit 1ca34b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/types/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export const TypeString: FC<TypeProps> = ({ children = '', keyName }) => {
const { shortenTextAfterLength: length = 30 } = useStore();
const { as, render, ...reset } = Str;
const childrenStr = children as string;
const [shorten, setShorten] = useState(length && childrenStr.length >= length);
useEffect(() => setShorten(length && childrenStr.length >= length), [length]);
const [shorten, setShorten] = useState(length && childrenStr.length > length);
useEffect(() => setShorten(length && childrenStr.length > length), [length]);
const Comp = as || 'span';
const style: React.CSSProperties = {
...defalutStyle,
Expand Down

0 comments on commit 1ca34b6

Please sign in to comment.