react-native-material-kit
react-native-material-kit copied to clipboard
Unhandled JS Exception: (intermediate value).withBackgroundColor(...).withShadowRadius is not a function
import React, { Component } from 'react';
import {
View
} from 'react-native';
import {
MKButton,
MKColor
} from 'react-native-material-kit';
const CustomButton = new MKButton.Builder()
.withBackgroundColor(MKColor.Teal)
.withShadowRadius(2)
.withShadowOffset({width:0, height:2})
.withShadowOpacity(.7)
.withShadowColor('black')
.withOnPress(() => {
console.log('hi, raised button!');
})
.withTextStyle({
color: 'white',
fontWeight: 'bold',
})
.withText('RAISED BUTTON')
.build();
class MKView extends Component{
constructor(props){
super(props);
}
render(){
return(
<View>
<CustomButton />
</View>
);
}
}
"react": "16.0.0-alpha.6",
"react-native-material-kit": "^0.4.1",
"react-native-vector-icons": "^4.0.1"
"react": "16.0.0-alpha.6",
why issue?
having the same issue 😢
the .withShadowRadius(2)
method doesn't even exist in the code. The only thing that seems to work is
const CustomButton = new MKButton.Builder()
.withBackgroundColor(MKColor.Teal)
Looks like the documentation is outdated but if anyone else is looking this up I found that you can mess with the shadow settings via the style. ex: .withStyle({shadowRadius: 10, shadowOpacity: 0.5})