forked from Only-IceSoul/react-native-clippath
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.js
24 lines (22 loc) · 780 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// main index.js
// import ClipPath from 'react-native-clippathview/src/ClipPath'
// import ClipPathH from 'react-native-clippathview/src/ClipPathH'
// export const ClipPathViewH = ClipPathH
// export const ClipPathView = ClipPath
import React from 'react';
import ClipPathNativeComponent from './src/ClipPathNativeComponent';
const ClipPath = React.forwardRef((props, ref) => {
const { style, ...otherProps } = props;
const { backgroundColor, ...otherStyle } = style;
let newProps = { ...otherProps, style: otherStyle };
if (backgroundColor) {
newProps.fill = backgroundColor;
}
return (
<ClipPathNativeComponent ref={ref} {...newProps}></ClipPathNativeComponent>
)
})
export {
ClipPath as ClipPathView
}
export default ClipPath