-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Question: how do I apply a style to an individual Scene? #2924
Comments
This isn't an answer to your question, but why can't you just apply the "sceneStyle" to the top-level-component for the Scene? This is what I have always done. import theme from 'application/theme';
const styles = { };
export default () => (
<View style={[theme.selected().scene, styles]}>
...
</View>
); This still applies the style to the scene you want to apply it to, plus you can reference the style and use it for a more globalized styling solution this way, (i.e: |
@ChristianTucker , yes, your example is what I ended up doing now with the removal of the "sceneStyle" property on the Scene element. Previously in v3.X, it was just nice in terms of visibility (especially in multi-person teams) to apply the style in a single file to all the Scenes in the Scene tree definition for the Router, rather than applying the style to each component for the Scene over multiple files. |
You may still try to apply different sceneStyle to individual component. |
Version
Is there a way to add a style to individual Scenes in v4.0.0? In v3.X, "sceneStyle" was a property on Scene, but in v4.0.0 "sceneStyle" has moved to Router, which applies a style to ALL Scenes.
There are instances where we want to apply a single style for 90% of our Scenes, but a different style to the other 10% of Scenes.
So, anything like "sceneStyle" as a property on Scene in v4.0.0?
The text was updated successfully, but these errors were encountered: