react-native-navigation的迁移库

api-overlay.mdx 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. ---
  2. id: overlay-api
  3. title: Overlay
  4. sidebar_label: Overlay
  5. ---
  6. ## `showOverlay()`
  7. Shows a component as an overlay.
  8. | Name | Required | Type | Description |
  9. | ------ | -------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  10. | layout | Yes | [Layout](Layout.mdx) | Any type of layout. Typically, Component layout is used in Overlays but it's possible to load any other layout ([BottomTabs](layout-BottomTabs.mdx), [Stack](stack-layout.mdx), [SideMenu](sideMenu-layout.mdx), [Component](layout-component.mdx)) |
  11. ```js
  12. Navigation.showOverlay({
  13. component: {
  14. name: 'example.Overlay',
  15. options: {
  16. overlay: {
  17. interceptTouchOutside: true
  18. }
  19. }
  20. }
  21. });
  22. ```
  23. ## `dismissOverlay()`
  24. Dismisses an overlay matching the given overlay componentId.
  25. #### Parameters
  26. | Name | Required | Type | Description |
  27. | ----------- | -------- | ------ | ------------------------------------- |
  28. | componentId | Yes | string | The component id presented in Overlay |
  29. ```js
  30. Navigation.dismissOverlay(this.props.componentId);
  31. ```