UNPKG
react-transparent
Version:
latest (1.1.4)
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.0
Make a component transparent
github.com/weiliy/react-transparent
weiliy/react-transparent
react-transparent
/
src
/
index.js
10 lines
(7 loc)
•
221 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
import
React
from
'react'
;
const
transparent
= C =>
by
=>
props
=>
( (
typeof
by ===
'function'
?
by
(props) : props[by] !==
undefined
) ?
<
C
{
...props
} />
: props.
children
||
null
);
export
default
transparent;