NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

Encountered error while trying to customize theme

Open CliveTeow opened this issue 9 years ago • 4 comments

react": "15.4.2" native-base": "^2.0.5" react-native": "0.41.2"

Expected behaviour

Able to customize the theme.

Actual behaviour

Shows error undefined is not a function (evaluating '(0,_color2.default)(this.radioColor).darken(0.2).hexString()')

Steps to reproduce (code snippet or screenshot)

Follow the steps in the documentation: http://docs.nativebase.io/CUSTOMIZE.html#Theming_NativeBase_Apps E.g. import {Container, Content, Text} from 'native-base'; import React, {Component} from 'react-native'; import getTheme from './native-base-theme/components'; import material from './native-base-theme/variables/material'; ​export default class ThemeExample extends Component { render() { return ( <StyleProvider style={getTheme(material)}> <Container> <Content> <Text> I have changed the text color. </Text> </Content> </Container> </StyleProvider> ); } }

Screenshot of emulator/device

screen shot 2017-04-22 at 10 15 25 pm

Is the bug present in both ios and android or in any one of them?

Both

CliveTeow avatar Apr 22 '17 14:04 CliveTeow

You need to change hexString() to string()

RichardLindhout avatar Apr 22 '17 15:04 RichardLindhout

And install npm install color -S

RichardLindhout avatar Apr 22 '17 15:04 RichardLindhout

@RichardLindhout It works. Thanks.

CliveTeow avatar Apr 25 '17 04:04 CliveTeow

Works for me as well. thanks!

eivindvr avatar Apr 04 '18 12:04 eivindvr