Nativebase: Encountered error while trying to customize theme

Created on 22 Apr 2017  路  4Comments  路  Source: GeekyAnts/NativeBase

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'; 鈥媏xport 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

Most helpful comment

And install npm install color -S

All 4 comments

You need to change hexString() to string()

And install npm install color -S

@RichardLindhout It works. Thanks.

Works for me as well. thanks!

Was this page helpful?
0 / 5 - 0 ratings