0.66 无效
Opened this issue · 1 comments
whhlulu commented
新版本写法
export const setCustomText = customProps => {
const TextRender = Text.render
const initialDefaultProps = Text.defaultProps
Text.defaultProps = {
...initialDefaultProps,
...customProps
}
Text.render = function render(props, ref) {
let oldProps = props
props = { ...props, style: [customProps.style, props.style] }
try {
return TextRender.apply(this, [props], ref)
} finally {
props = oldProps
}
}
}
dioi2000 commented
i guess you had same problem with me
use this - https://www.npmjs.com/package/react-native-simple-default-props