-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
data.isReactElement has been deprecated from RN 0.13 #120
Comments
This is the way I fixed. //from
getButtonElement(data = {}, style) {
console.log('data inside module', data);
if (data._isReactElement ){
return <View style={styles.navBarButton}>{data}</View>;
}
//
getButtonElement(data = {}, style) {
console.log('data inside module', data);
if (!!data.props ){
return <View style={styles.navBarButton}>{data}</View>;
} and // from
getTitleElement(data) {
if (data._isReactElement) {
return <View style={styles.customTitle}>{data}</View>;
}
//to
getTitleElement(data) {
if (!!data.props) {
return <View style={styles.customTitle}>{data}</View>;
} However, to make it work, inside <NavigationBar
leftButton={
<TouchableOpacity style={styles.buttonNavBar} onPress={()=> this.props.navigator.pop()}>
<Image
source={require('../img/back-icon.png')}
style={[{ width: 15, height: 15}]}/>
</TouchableOpacity>
}/> I have to define the component directly to leftButton and not creating a class Component because the later one is gotten as a function. |
LGTM, can you compose a PR? |
Fixed in #121 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Inside index.js that belongs to react-native-navbar, there is an if statement that is not being triggered when a react component is passed through "leftButton" prop.
At any given time, data._isReactElement is not recognized. There is chance that it got deprecated after RN 0.13 (facebook/react#3220 and facebook/react#3473).
Any workaround for this?
The text was updated successfully, but these errors were encountered: