UNPKG
@wener/ui
Version:
latest (1.0.0-alpha.18)
1.0.0-alpha.18
1.0.0-alpha.17
1.0.0-alpha.16
1.0.0-alpha.15
1.0.0-alpha.13
1.0.0-alpha.12
1.0.0-alpha.11
1.0.0-alpha.10
1.0.0-alpha.9
1.0.0-alpha.8
1.0.0-alpha.7
1.0.0-alpha.6
@wener/ui
/
src
/
hocs
/
withProps.ts
7 lines
(5 loc)
•
246 B
text/typescript
View Raw
1
2
3
4
5
6
7
import
React
from
'react'
;
/// add default props to WrappedComponent
export
function
withProps
(
WrappedComponent
:
React
.
ElementType
,
extra
:
any
) {
return
(
props
:
any
) =>
React
.
createElement
(
WrappedComponent
,
Object
.
assign
({}, props, extra)); }