Browse Source

Fix code sample in the documentation for layouts bottomTabs (#4808)

Add curly braces around the visible property
mukesh mandiwal 5 years ago
parent
commit
047ea44fea
1 changed files with 11 additions and 6 deletions
  1. 11
    6
      docs/docs/layout-types.md

+ 11
- 6
docs/docs/layout-types.md View File

@@ -124,6 +124,7 @@ Navigation.mergeOptions(this.props.componentId, {
124 124
 ```
125 125
 
126 126
 ### Changing BottomTabs visibility
127
+
127 128
 The `visible` property can be used to control the BottomTab visibility.
128 129
 
129 130
 On **Android**, Visibility can be toggled dynamically using the `mergeOptions` command. When hiding BottomTabs, `drawBehind: true` should be specified in order for the screen to render behind the area which was previously allocated to the BottomTabs.
@@ -141,15 +142,19 @@ On **both** platforms visibility can be changed when pushing screens into a stac
141 142
 
142 143
 ```js
143 144
 Navigation.push(componentId, {
144
-	component: {
145
-	  name: 'pushedScreen',
146
-	  options: { bottomTabs: visible: false }
147
-	}
148
-  });
145
+  component: {
146
+    name: 'pushedScreen',
147
+    options: {
148
+      bottomTabs: {
149
+        visible: false
150
+      }
151
+    }
152
+  }
153
+});
149 154
 ```
150 155
 
151
-
152 156
 ### Updating options for a specific tab
157
+
153 158
 Updating (merging) tab specific options is done using the `mergeOptions` command. `mergeOptions` expects a `componentId` as first argument, therefore in order to update a specific tab we'll need to pass a `componentId` of a child of that specific tab.
154 159
 For example, Using the layout specified above, To update the `badge` property of the second tab we'll call `mergeOptions` with `SecondScreenId`.
155 160