-
Notifications
You must be signed in to change notification settings - Fork 2.4k
TypeError: theme[_base.themePropertyMap[property]] is not a function #4116
Copy link
Copy link
Closed
Labels
v3V3V3
Description
Describe the bug
I am suddenly getting the following error after having upgraded to v3.2.0:
TypeError: theme[_base.themePropertyMap[property]] is not a function. (In 'theme[_base.themePropertyMap[property]](colorModeProps)', 'theme[_base.themePropertyMap[property]]' is an instance of Object)
This error is located at:
in ForwardRef (at Icon.tsx:30)
Now even after having downgradedback to v3.1.0 I'm still having the same error, not sure why...
To Reproduce
This code was working before upgrading. I'm not sure exactly what steps to follow to reproduce it.
Here is the breaking codes:
1. breaking component: IconButton
<IconButton
onPress={onPress}
variant={active ? "outline" : "ghost"}
borderColor={active ? "theme-primary" : "gray.200"}
rounded="full"
bg={active ? "violet.200" : "gray.300"}
_pressed={{
bg: "violet.200",
}}
shadow={8}
style={{...}}
icon={
<Icon
shadow={3}
size={8}
color={active ? "theme-primary" : "blueGray.500"}
as={MaterialIcons}
name={name}
/>
}
/>
And here is my theme object:
export const appTheme = extendTheme({
colors: {
"theme-primary": baseTheme.colors.green[500],
"theme-secondary": baseTheme.colors.lime[300],
},
components: {
Text: {
baseStyle: {
color: "blueGray.500",
},
},
Heading: {
baseStyle: {
color: "blueGray.500",
fontWeight: "light",
},
},
},
});
Expected behaviour
Application should not crash and work like before
Platform
- NativeBase version 3.2.0 && 3.1.0
- Device: iphone 12, android
- React Native version sdk 42
- Expo sdk 42
- node 14
- yarn 1
- Add any other context about the problem here.
- Is the bug present in both iOS and Android or in any one of them?
- If you want your issue to be looked at quicker, please attach a snack reproducible with your issue. Makes it easier for us!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
v3V3V3
