wix / react-native-navigation

A complete native navigation solution for React Native
https://wix.github.io/react-native-navigation/
MIT License
13.03k stars 2.67k forks source link

setDefaultOptions overrides options when called again. #6980

Open a-eid opened 3 years ago

a-eid commented 3 years ago

🐛 Bug Report

this might not be the case for every options but it is when you set layout it does override at least animations.

To Reproduce

setDefaultOptions

Expected behavior

just calling setDefaultOptions overrides the animations key set before.

Actual Behavior

setDefaultOptions show merge and not override.

Your Environment

Reproducible Demo

https://github.com/a-eid/rnn/tree/bug/setDefaultOptions

AlphaJuliettOmega commented 3 years ago

hey @a-eid, shouldn't you be using MergeOptions when you want to change it after setting the DefaultOptions?

It makes sense to me that it'd wipe the other options you've set if you set DefaultOptions a second time.

a-eid commented 3 years ago

@AlphaJuliettOmega in some cases you have to use setDefaultOptions, if I remember correctly you have to use it when setting the direction of the layout or something, if you want I can check and report back.

also actually it specifies in the does that setDefaultOptions merges with the previous one.

LitileXueZha commented 2 years ago

setDefaultOptions() through merge is very useful for unmount components. Hope can fix it!