Skip to content
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

leftButtonImage is not working #2207

Closed
shukerullah opened this issue Aug 9, 2017 · 10 comments
Closed

leftButtonImage is not working #2207

shukerullah opened this issue Aug 9, 2017 · 10 comments

Comments

@shukerullah
Copy link

shukerullah commented Aug 9, 2017

Version

  • react-native-router-flux v4.0.0-beta.17
  • react-native v0.47.1

rightButtonImage with source is working but leftButtonImage does not appear.

Actions.refresh({
  back: true,
  rightButtonImage: source,
  leftButtonImage: source,
  onLeft: () => func,
  onRight: () => func
});
@aksonov
Copy link
Owner

aksonov commented Aug 10, 2017

I can't reproduce it. Just replaced rightTitle within Login.js of Example project:

    Actions.refresh({
      title: 'Login!',
      //rightTitle: 'rightTitle',
      rightButtonImage: require('../images/menu_burger.png'),
      onRight: () => {},
    });

and saw image normally.

Please fork & modify Example project to demonstrate issue.

@shukerullah shukerullah changed the title rightButtonImage is not working leftButtonImage is not working Aug 10, 2017
@shukerullah
Copy link
Author

leftTitle and rightTitle both are working in Example.

@shukerullah
Copy link
Author

leftButtonImage is not working, its because navigationParams.leftButtonImage condition is missing in navigationStore.js, leftButtonImage working on v4.0.0-beta.16.

Version

  • react-native-router-flux v4.0.0-beta.17

@aksonov
Copy link
Owner

aksonov commented Aug 10, 2017

Thanks! Please check latest master

@shukerullah
Copy link
Author

Thank you for quick response.

@shukerullah
Copy link
Author

Still leftButtonImage is not working, but if I move navigationParams.leftButtonImage outside the onLeft condition then its working.

From

((onLeft && (leftTitle || navigationParams.leftTitle || leftButtonImage || navigationParams.leftButtonImage)) || drawerImage || drawerIcon)

To

((onLeft && (leftTitle || navigationParams.leftTitle || leftButtonImage)) || drawerImage || drawerIcon || navigationParams.leftButtonImage)

Version

react-native-router-flux v4.0.0-beta.18

@ssomnoremac
Copy link

migrating from v3, I assume there is no longer back, there is only left?
If so, then yeah this isn't working for me.
<Scene ... leftButtonImage={backImage}/>

Version

react-native-router-flux": "^4.0.0-beta.21

@Dhrupal
Copy link

Dhrupal commented Oct 11, 2017

Does this issue resolved in latest, because following code is not changing left title to image.:
Actions.refresh({
leftButtonImage:src,
onLeft: () => {
this.props.onRefresh()
},
});

Note:
react-native-router-flux ^4.0.0-beta.22
react-native ^0.47.2

@hatemjaber
Copy link

onLeft is not working for me either. I have tried quite a few things and cannot control the < in the header to run custom code within it. I wrote a custom component and it only worked for the > 'right' button which worked with both 'renderRightButton' and 'right'.

<Scene key="employeeList" component={EmployeeList} title="Employees" right={() => { return ( <RightButton onPress={() => Actions.employeeCreate()}> Add </RightButton> ); }} initial /> <Scene key="employeeCreate" component={EmployeeCreate} title="Create Employee" onLeft={() => console.log('backbutton from create pressed....')} /> <Scene key="employeeEdit" component={EmployeeEdit} title="Edit Employee" onLeft={() => { console.log('backbutton from edit pressed....'); }} /> </Scene>

what is the proper way to go back and to customize the functionality?

@Dhrupal
Copy link

Dhrupal commented Oct 17, 2017

Actually mine is working now, i have added this, which is not allowing to access left in ios
static navigationOptions =Platform.OS =='ios' && {
headerLeft: (

<Text onPress={() => Actions.pop()} >Cancel
)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants