Skip to content

Commit 420b118

Browse files
committed
ver 1.1.3
1 parent 5706a69 commit 420b118

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-clippathview",
33
"title": "React Native ClipPath",
4-
"version": "1.1.2",
4+
"version": "1.1.3",
55
"description": "ClipPath Android Web IOS",
66
"main": "index.js",
77
"files": [

src/ClipPathWeb.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,23 @@ const ClipPathWeb = React.forwardRef((props,ref) =>{
147147
...rest
148148
} = props
149149

150-
const styleObject = StyleSheet.flatten(style)
150+
const styleObject = useMemo(()=>{
151+
if (typeof style === 'number') return StyleSheet.flatten(style)
152+
if(Array.isArray(style)){
153+
var styleJs = {}
154+
style.forEach((v)=>{
155+
if(typeof v === 'number'){
156+
let ss = StyleSheet.flatten(style)
157+
Object.assign(styleJs,ss)
158+
}else{
159+
Object.assign(styleJs,v)
160+
}
161+
})
162+
163+
return styleJs
164+
}
165+
return style
166+
},[style])
151167

152168
const path = d === undefined ? "" : d
153169
const vb = viewBox === undefined ? [0,0,-1,-1] : viewBox

0 commit comments

Comments
 (0)