【发布时间】:2016-06-03 02:55:54
【问题描述】:
我从npm 下载了一个效果很好的组件,但我想知道是否有办法覆盖该组件的默认样式?就像我使用 CSS 时可以覆盖样式一样。
样式当前在位于node_modules/react-native-floating-label-text-input的组件的index.js文件中定义。
我想做这样的事情:
<FloatLabelTextInput style={styles.textbox} />
const styles = StyleSheet.create({
textbox: {
container: {
height: 30,
backgroundColor: 'red'
}, etc...
}
});
其中styles.textbox 包含组件的所有新样式。我以这个组件为例,但这可能适用于来自npm 的任何组件。
谢谢。
【问题讨论】:
标签: javascript node.js npm styles react-native