Skip to content

How does setting and merging of options actually works? #7021

@ghost

Description

📚 Documentation

Currently, we can set component options by multiple ways:

  1. Navigation.setDefaultOptions
  2. Navigation.mergeOptions
  3. Layout definition (via Navigation.push, Navigation.setRoot...)
  4. Static options on component

My questions are:

  1. When options are set to the component for the first time?
    - It is in time of component registering (Navigation.setDefaultOptions),
    - or before mounting when no animation happened yet (Navigation.setRoot...),
    - or at any time (Navigation.mergeOptions)?
  2. How does the merging process works? What takes the precedence? What is the order?
  3. Does merging algorithm handles every property anywhere deep in the layout, or does it only replaces whole sections (like BottomTabsOptions, TopBarOptions etc.)?
  4. Can Navigation.setDefaultOptions be called multiple times?
  5. Does calling Navigation.setDefaultOptions update already mounted and appeared component? And does it trigger the whole merging process as defined in question no. 2?
  6. Does calling Navigation.mergeOptions trigger the whole merging process as defined in question no. 2? That means that it for examples merges with default options - if defined.

It would be great to have some diagram demonstrating the whole flow.

Thanks for reply.

Have you read the Contributing Guidelines on issues?

Partially

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions