Skip to content

Commit a84bc30

Browse files
committed
fix isSlice is not a funciton error
1 parent bd67803 commit a84bc30

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/components/TopTagSuggestions/index.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ const TopTagSuggestions = (props) => {
3636
return null;
3737
}
3838

39-
// Parse current tags to avoid duplicates
40-
const currentTagsArray = props.currentTags ? props.currentTags.split(/,\s*/) : [];
39+
// Parse current tags to avoid duplicates (supports string or array)
40+
const currentTagsArray = Array.isArray(props.currentTags)
41+
? props.currentTags
42+
: typeof props.currentTags === "string" && props.currentTags.length > 0
43+
? props.currentTags.split(/,\s*/)
44+
: [];
4145

4246
return (
4347
<div className="mr-mt-4">

0 commit comments

Comments
 (0)