react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

Navigation.setDefaultOptions Does NOT work on V3.1.0!

Open mrxrinc opened this issue 7 years ago • 25 comments

Issue Description

Just create a fresh project RN0.60.5 & RNN 3.1.0, the Navigation.setDefaultOptions does not work!. actually Im about to never again use RNN in future projects! :(


Environment

  • React Native Navigation version: 3.1.0
  • React Native version: 0.60.5
  • Platform(s) (iOS, Android, or both?): IOS
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator iphone 8

mrxrinc avatar Aug 21 '19 08:08 mrxrinc

I'm using it in V3. Did you set it before calling setRoot, as described in the docs? https://wix.github.io/react-native-navigation/#/docs/styling?id=enabling-persistent-styling-properties

ghost avatar Aug 21 '19 08:08 ghost

It works in 3.0 but not in 3.1.

pontusab avatar Aug 21 '19 09:08 pontusab

@Damar95 yes I did everything I could imagine! but there is no result!

mrxrinc avatar Aug 21 '19 09:08 mrxrinc

@guyca Please help!

mrxrinc avatar Aug 21 '19 09:08 mrxrinc

@mrxrinc Agreed it doesn't work. Downgrade to v3.0.0 for it to be resolve temporarily.

TylerNRobertson avatar Aug 21 '19 10:08 TylerNRobertson

@mrxrinc Are all options you set don't work? Or is it a specific option?

guyca avatar Aug 21 '19 12:08 guyca

Seems like its a iOS only bug. 3.1.0 works for me on android.

Navigation.setDefaultOptions({
            layout: {
                // componentBackgroundColor: 'lightgray',
                direction: 'ltr',
            },
            statusBar: {
                visible: true,
                style: 'dark',
                backgroundColor: 'rgb(85, 128, 0)', 
            },
            topBar: {
                visible: true,
                background: {
                    color: 'rgb(85, 128, 0)',
                },
            },
            bottomTabs: {
                style: 'dark',
                textColor: 'rgb(0, 0, 0)',
                backgroundColor: 'rgb(85, 128, 0)',
            },
            bottomTab: {
                iconColor: 'rgb(50, 50, 50)',
                textColor: 'rgb(50, 50, 50)',
                selectedIconColor: 'rgb(0, 0, 0)',
                selectedTextColor: 'rgb(0, 0, 0)',
            },
            // backgroundImage: require('./../assets/img/background.jpg')
        });

ghost avatar Aug 21 '19 12:08 ghost

@guyca non working!

Navigation.setDefaultOptions({
    topBar: {
      visible: false,
      drawBehind: true
    },
    layout: {
      orientation: ['portrait'],
      backgroundColor: '#32434C'
    },
    statusBar: {
      blur: true,
      drawBehind: true,
      backgroundColor: '#00000011',
      style: 'light'
    }
  })

mrxrinc avatar Aug 21 '19 12:08 mrxrinc

Having the same problem on iOS. 3.0 works fine, but 3.1 doesn't

OmgDef avatar Aug 21 '19 13:08 OmgDef

same issue here it's not working on ios ver: 3.1

AbanoubNassem avatar Aug 21 '19 14:08 AbanoubNassem

Sorry for the trouble guys. I'm on this. Unfortunately the e2e which should have caught this bug was bugged as well 😕 I should have a fix by tomorrow, you can use 3.0.0 until then, thanks for your patience 👍

guyca avatar Aug 21 '19 15:08 guyca

Alright, fixed in 3.1.1. Please let me know if there any more issues regarding defaultOptions

guyca avatar Aug 22 '19 07:08 guyca

@guyca Thanks in advance. should I update it with

npm install --save [email protected]

mrxrinc avatar Aug 22 '19 08:08 mrxrinc

For me, v3.1.1. not solve my problem. =( Any idea??

React Native Navigation version: 3.1.0 React Native version: 0.60.5 Platform: IOS Device info: Simulator iphone X

tiagomelilo avatar Aug 22 '19 18:08 tiagomelilo

For ios everything works fine v3.1.1 (just need to reinstall pods). But on android bottomTabs {visible: false, drawBehind: true} in setDefaultOptions doesn't work need to add option in each screen to work it correctly P/s (sorry for my English)

sharipkanov avatar Aug 23 '19 04:08 sharipkanov

@guyca Still doesn't work! tried 'npm install --save [email protected]' also 'pod install'. None is working!

mrxrinc avatar Aug 24 '19 06:08 mrxrinc

@mrxrinc, try cd ios && pod update. If still not working:

rm -rf ios/build
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf lib
watchman watch-del-all
rm -rf node_modules
rm -rf $TMPDIR/npm-*
rm -rf $TMPDIR/haste-*
rm -rf $TMPDIR/metro-*
rm -rf $TMPDIR/haste-map-react-native-packager-*
npm install

then cd ios && pod update

terreb avatar Aug 27 '19 12:08 terreb

I can confirm that updating to 3.1.2 fixed the issue. I didn't try 3.1.1 though.

andres-torres-marroquin avatar Aug 27 '19 19:08 andres-torres-marroquin

I have 3.2.0 installed and can't change the statusBar style.

vnshgrg avatar Sep 11 '19 06:09 vnshgrg

Same, I'm on 3.2.0 and this can't change the statusBar style either

rvera avatar Oct 08 '19 14:10 rvera