Skip to content

Commit

Permalink
perf: replace substr with splice (#8882)
Browse files Browse the repository at this point in the history
  • Loading branch information
cycleccc authored Nov 26, 2024
1 parent 30b6f01 commit 53e5cc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/utils/src/components/FieldLabel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ const FieldLabelFunction: React.ForwardRefRenderFunction<
{prefix}
<span style={{ paddingInlineStart: 4, display: 'flex' }}>
{typeof str === 'string'
? str?.toString()?.substr?.(0, valueMaxLength)
? str?.toString()?.slice?.(0, valueMaxLength)
: str}
</span>
{tail}
Expand Down

0 comments on commit 53e5cc7

Please sign in to comment.