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

sceneStyle gets not applied #2255

Closed
Stophface opened this issue Aug 17, 2017 · 2 comments
Closed

sceneStyle gets not applied #2255

Stophface opened this issue Aug 17, 2017 · 2 comments

Comments

@Stophface
Copy link

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.16
  • react-native v0.46.1

Expected behaviour

I want to change the backgroundColor of the whole RouterObject
Trying the code from the example does not do the trick neither.

Actual behaviour

The sceneStyle gets not applied

Steps to reproduce

My try

export default class TestComp extends Component {
  render() {
    return (
      <Router sceneStyle = {styles.container}>
        <Scene key = "root">
          <Scene 
            key = "index"
            component = {NumberOne}
            title = "Headline"
            titleStyle = {styles.header}
            initial 
            />
          <Scene
            key = "Test2"
            component = {NumberTwo} 
            />
      </Router>
    )
  }
};

const styles = StyleSheet.create({
  container: {
    backgroundColor: "red"
  },  
});

Code from example

const getSceneStyle = () => ({
  backgroundColor: "white",
  shadowOpacity: 1,
  shadowRadius: 3,
});

export default class TestComp extends Component {
  render() {
    return (
      <Router getSceneStyle={getSceneStyle}>
        <Scene key = "root">
          <Scene 
            key = "index"
            component = {NumberOne}
            title = "Headline"
            titleStyle = {styles.header}
            initial 
            />
          <Scene
            key = "Test2"
            component = {NumberTwo} 
            />
      </Router>
    )
  }
};
@aksonov
Copy link
Owner

aksonov commented Aug 17, 2017

Please always try to latest version before posting issues (now it is beta.18)

@Stophface
Copy link
Author

That solved it. Thanks for the awesome support!

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

2 participants