UNPKG

antd-mobile-taro-icons

Version:

基于Taro框架的小程序图标库

13 lines (12 loc) 460 B
import React from 'react'; import classNames from 'classnames'; export function withNativeProps(props, element) { const p = Object.assign({}, element.props); if (props.className) { p.className = classNames(element.props.className, props.className); } if (props.style) { p.style = Object.assign(Object.assign({}, p.style), props.style); } return React.cloneElement(element, Object.assign(Object.assign({}, props), p)); }