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

Static leftButtonImage not working #2883

Closed
alexey-pelykh opened this issue Feb 14, 2018 · 5 comments
Closed

Static leftButtonImage not working #2883

alexey-pelykh opened this issue Feb 14, 2018 · 5 comments

Comments

@alexey-pelykh
Copy link

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.28 (v3 is not supported)
  • react-native v0.53.0

Expected behaviour

static leftButtonImage = () => {
    return require('./assets/image.png');
}

works as expected

Actual behaviour

Not working

Steps to fix

https://github.com/aksonov/react-native-router-flux/blob/master/src/navigationStore.js#L191
this check does not take componentData into the account, so either it should be removed to work as onRight portion, or expanded

Workaround

leftButtonImage={something}

in the <Scene/> declaration

@M3po
Copy link

M3po commented Feb 14, 2018

Having same problem, same versions

@delia-m
Copy link

delia-m commented Feb 15, 2018

leftButtonImage shouldn't be a function...
try this leftButtonImage={require('./assets/image.png')}

@alexey-pelykh
Copy link
Author

It's irrelevant if it's a function, tried all ways possible
This works:

  static get rightButtonImage () {
    return require('./assets/correct-darkblue.png');
  }

  static get onRight () {
    return () => Actions.editprofile();
  }

This does not:

static get leftButtonImage () {
    return require('./assets/done.png');
  }

  static get onLeft () {
    return () => Actions.about();
  }

@alexey-pelykh
Copy link
Author

@delia-m fyi: https://github.com/aksonov/react-native-router-flux/blob/master/src/NavBar.js#L79 is the reason why leftButtonImage may be a function

@aksonov
Copy link
Owner

aksonov commented Aug 8, 2018

Please try to reproduce it with Example project and latest version 4.0.0-beta.40. Feel free to open if the issue still exists

@aksonov aksonov closed this as completed Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants