Skip to content

Commit c8a6b6c

Browse files
authored
fix(hydration): use useId for dom variant (#325)
1 parent 7dd345f commit c8a6b6c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"typescript": "5.4.2"
103103
},
104104
"peerDependencies": {
105-
"react": ">=16.0.0"
105+
"react": ">=18.0.0"
106106
},
107107
"husky": {
108108
"hooks": {

src/web/Svg.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as React from 'react'
22

3-
import uid from '../shared/uid'
43
import { IContentLoaderProps } from './'
54

65
const SVG: React.FC<IContentLoaderProps> = ({
@@ -20,7 +19,8 @@ const SVG: React.FC<IContentLoaderProps> = ({
2019
beforeMask = null,
2120
...props
2221
}) => {
23-
const fixedId = uniqueKey || uid()
22+
let fixedId = React.useId()
23+
if (uniqueKey) fixedId = uniqueKey
2424
const idClip = `${fixedId}-diff`
2525
const idGradient = `${fixedId}-animated-diff`
2626
const idAria = `${fixedId}-aria`

0 commit comments

Comments
 (0)