Skip to content

Commit 8796960

Browse files
authored
fix(native): creates the styles obj using assign (#183)
closes #182
1 parent b3ea38e commit 8796960

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-content-loader",
3-
"version": "4.4.2",
3+
"version": "5.0.1",
44
"description": "SVG-Powered component to easily create placeholder loadings (like Facebook cards loading)",
55
"repository": {
66
"type": "git",

src/native/Svg.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,16 @@ class NativeSvg extends Component<IContentLoaderProps, { offset: number }> {
7979
const offset2 = offsetValueBound(this.state.offset)
8080
const offset3 = offsetValueBound(this.state.offset + 1)
8181

82-
const rtlStyle = rtl ? { transform: [{ rotateY: '180deg' }] } : {}
83-
const composedStyle = Object.assign(style, rtlStyle)
82+
const rtlStyle: object = rtl ? { transform: [{ rotateY: '180deg' }] } : {}
83+
const svgStyle = Object.assign(Object.assign({}, style), rtlStyle)
8484

8585
// Remove unnecessary keys
8686
delete props.uniqueKey
8787
delete props.animate
8888
delete props.speed
8989

9090
return (
91-
<Svg style={composedStyle} {...props}>
91+
<Svg style={svgStyle} {...props}>
9292
<Rect
9393
x="0"
9494
y="0"

0 commit comments

Comments
 (0)