react-native-navigation的迁移库

api-options.mdx 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ---
  2. id: options-api
  3. title: Options Commands
  4. sidebar_label: Options commands
  5. ---
  6. ## `setDefaultOptions`
  7. Set default options for all screens. Useful for declaring a consistent style across the app.
  8. #### Parameters
  9. | Name | Type | Required | Description |
  10. | ------- | ----------------------- | -------- | ------------ |
  11. | options | [Options](options-root.mdx) | Yes | Options root |
  12. #### Example
  13. ```js
  14. Navigation.setDefaultOptions({
  15. bottomTab: {
  16. textColor: "black",
  17. selectedTextColor: "blue"
  18. }
  19. });
  20. ```
  21. ## `mergeOptions`
  22. Change navigation options of a component.
  23. #### Parameters
  24. | Name | Type | Required | Description |
  25. | ----------- | ----------------------- | -------- | ---------------- |
  26. | componentId | string | Yes | The component id |
  27. | options | [Options](options-root.mdx) | Yes | Options root |
  28. #### Example
  29. ```js
  30. Navigation.mergeOptions('componentId', {
  31. bottomTabs: {
  32. visible: false
  33. }
  34. });
  35. ```