connectStyle with empty defaultStyle parameter
react-native, react and native-base version
"native-base": "2.3.3", "react": "^16.1.1", "react-native": "^0.50.4",
Expected behaviour
Specifying {} to connectStyle as 2nd (defaultStyles) parameter should allow to style nested custom component in getTheme function.
Actual behaviour
If {} is passed to connectStyle component won't be recognized, styleName of component in getTheme will be ignored.
Steps to reproduce (code snippet or screenshot)
Create custom component e.g.
class Hello extends PureComponent {
render() {
return (
<View>
<Text>Hello</Text>
</View>
);
}
}
export default connectStyle('Test.Hello', {})(Hello);
let's say that this component is children of NativeBase.Form so counting with that i should be able to add styles to
'NativeBase.Form': {
'Test.Hello': {
'NativeBase.ViewNB': {
backgroundColor: 'red'
}
},
...formTheme(),
},
but if u are passing {}/StyleSheet.create({})/false as second argument to connectStyle hoc it won't work. But in case u'll send there for example { a: {} } so export looks like this export default connectStyle('Test.Hello', {a : {}})(Hello); it will work.
PS If u are not nesting component in style definition it works so if u have directly in getTheme first level key Test.Hello with its styles definition it works.
Screenshot of emulator/device
vs
Is the bug present in both ios and android or in any one of them?
yes
Any other additional info which would help us debug the issue quicker.
I think i provided all the necessary steps to reproduce a bug.
Hi @Xvie , can you provide minimal code reproduction for the same? And let us know if the issue still persists.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Closing this for now. Let us know if you are still facing this issue