larsvinter / react-native-awesome-button

A button React Native component supporting showing different states with animations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

undefined is not an object (evaluating 'hex.replace')

kenjim83 opened this issue · comments

I get the above error from hexToRbg
AwesomeButton.js 53:0

When using the Simple Example:

class Simple extends Component {

  handleButtonPress() {
    console.log('I was pressed')
  }

  render() {
    return (
      <View style={styles.container}>
        <AwesomeButton states={{
                        default: {
                          text: 'Press me',
                          onPress: this.handleButtonPress
                        }
                       }} />
      </View>
    )
  }

}

You have to set backgroundColor in every state in states. backgroundColor has to be in the hexadecimal format as well.

Example updated to reflect the need to always set backgroundColor for each state