You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the main component generates random values to match the id of the SVG element with background style, it can encounter unexpected errors and unmatching warning on render, once the random value of id will be generated twice, in case of SSR: server and client; or in case of snapshot test: on the first match and re-running the test.
251
+
252
+
To fix it, set the prop [`uniqueKey`](https://github.com/danilowoz/react-content-loader#uniquekey-string---web-only), then the id will not be random anymore:
When using `rgba` as a `backgroundColor` or `foregroundColor` value, [Safari does not respect the alpha channel](https://github.com/w3c/svgwg/issues/180), meaning that the color will be opaque. To prevent this, instead of using a `rgba` value for `backgroundColor`/`foregroundColor`, use the `rgb` equivalent and move the alpha channel value to the `backgroundOpacity`/`foregroundOpacity` props.
264
+
265
+
```jsx
266
+
{/* Opaque color in Safari and iOS */}
267
+
<ContentLoader
268
+
backgroundColor="rgba(0,0,0,0.06)"
269
+
foregroundColor="rgba(0,0,0,0.12)">
270
+
271
+
272
+
{/_ Semi-transparent color in Safari and iOS _/}
273
+
<ContentLoader
274
+
backgroundColor="rgb(0,0,0)"
275
+
foregroundColor="rgb(0,0,0)"
276
+
backgroundOpacity={0.06}
277
+
foregroundOpacity={0.12}>
278
+
279
+
280
+
```
281
+
282
+
#### **Black box in Safari / iOS (again)**
283
+
284
+
Using the base tag on a page that contains SVG elements fails to render and it looks like a black box. Just remove the **base-href** tag from the `<head />` and issue solved.
When using `rgba` as a `backgroundColor` or `foregroundColor` value, [Safari does not respect the alpha channel](https://github.com/w3c/svgwg/issues/180), meaning that the color will be opaque. To prevent this, instead of using an `rgba` value for `backgroundColor`/`foregroundColor`, use the `rgb` equivalent and move the alpha channel value to the `backgroundOpacity`/`foregroundOpacity` props.
293
-
294
-
```jsx
295
-
{/* Opaque color in Safari and iOS */}
296
-
<ContentLoader
297
-
backgroundColor="rgba(0,0,0,0.06)"
298
-
foregroundColor="rgba(0,0,0,0.12)">
299
-
300
-
301
-
{/_ Semi-transparent color in Safari and iOS _/}
302
-
<ContentLoader
303
-
backgroundColor="rgb(0,0,0)"
304
-
foregroundColor="rgb(0,0,0)"
305
-
backgroundOpacity={0.06}
306
-
foregroundOpacity={0.12}>
307
-
308
-
309
-
```
310
-
311
-
##### **Black box in Safari / iOS (again)**
312
-
313
-
Using base tag on a page that contains SVG elements fails to render and it looks like a black box. Just remove the **base-href** tag from the `<head />` and issue solved.
0 commit comments