Skip to content

Commit cbc5940

Browse files
andnordaKenAJoh
andauthored
[fix] prepend svg title id to avoid id starting with num (navikt#1490)
* prepend svg title id to avoid id starting with num * Update @navikt/core/icons/template.js Co-authored-by: Ken <[email protected]> * dont pass unnecessary arg to useId Co-authored-by: Ken <[email protected]>
1 parent 104ab0d commit cbc5940

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

@navikt/core/icons/template.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ function defaultTemplate(
3535
${imports}
3636
${interfaces}
3737
const ${componentName} = React.forwardRef((${props}) => {
38-
let titleId: string | undefined = useId(_titleId);
39-
titleId = title ? titleId : undefined;
38+
let titleId: string | undefined = useId();
39+
titleId = title ? _titleId ? _titleId : "title-" + titleId : undefined;
4040
return ${jsx};
4141
});
4242
export default ${componentName}`;

0 commit comments

Comments
 (0)