{"_id":"59bc03d31d2d8d001a344596","category":{"_id":"59bc03d31d2d8d001a344583","version":"59bc03d31d2d8d001a34457d","project":"578c4badbd223d2000cc1441","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-08-01T23:04:12.838Z","from_sync":false,"order":6,"slug":"api-reference","title":"API Reference"},"parentDoc":null,"project":"578c4badbd223d2000cc1441","user":"57bb7defafc18c0e00529cf1","version":{"_id":"59bc03d31d2d8d001a34457d","project":"578c4badbd223d2000cc1441","__v":2,"createdAt":"2017-09-15T16:46:11.721Z","releaseDate":"2017-09-15T16:46:11.721Z","categories":["59bc03d31d2d8d001a34457e","59bc03d31d2d8d001a34457f","59bc03d31d2d8d001a344580","59bc03d31d2d8d001a344581","59bc03d31d2d8d001a344582","59bc03d31d2d8d001a344583","59bc284b7c3f420010f965e6"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0.0"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-10-18T03:45:24.954Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":27,"body":"A ViroSceneNavigator component is the entry point for VR applications.  Please see our [Scene Navigation Guide](scene-navigation) for more information on how to properly navigate between scenes.\n\n######Example use:\n```\nvar MyStartScene = require('./MyStartScene');\n\nimport {\n  AppRegistry,\n  ViroScene,\n  ViroSceneNavigator,\n} from 'react-viro';\n\nvar ViroSceneNav = React.createClass({\n  render: function() {\n    return (\n      <ViroSceneNavigator\n        initialScene={{\n          scene: MyStartScene,\n        }}\n      />\n    );\n  }\n})\n```\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Props\"\n}\n[/block]\n##Required Props\n[block:parameters]\n{\n  \"data\": {\n    \"h-1\": \"PropType\",\n    \"h-0\": \"PropKey\",\n    \"0-0\": \"**apiKey**\",\n    \"0-1\": \"**PropTypes.string.isRequired
**
\\n\\nRequired API Key\",\n    \"1-0\": \"**initialScene**\",\n    \"1-1\": \"**PropTypes.shape( {scene: PropTypes.func.isRequired
} ),**
\\n\\nThe initial scene to display for your application on application start.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n##Optional Props \n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"** debug**\",\n    \"3-0\": \"** vrModeEnabled**\",\n    \"4-0\": \"**rotation**\",\n    \"5-0\": \"**style**\",\n    \"6-0\": \"**text**\",\n    \"7-0\": \"**transformBehaviors**\",\n    \"9-0\": \"**visible**\",\n    \"8-0\": \"**width**\",\n    \"h-0\": \"PropKey\",\n    \"h-1\": \"PropType\",\n    \"0-1\": \"**PropTypes.bool**\\n\\nUsed to enable dev menu on Android Nougat device with Cardboard.\",\n    \"3-1\": \"**PropTypes.bool**\\n\\nCalling vrModeEnabled allows switching to and from VR mode. When set to false, it transitions back to pre-VR (mono) mode.  When set to true, we set thie view into a full VR mode.  This is set to true by default.\",\n    \"4-1\": \"PropTypes.arrayOf(PropTypes.number)\\n\\nPut the PropType Description here.\",\n    \"5-1\": \"stylePropType\",\n    \"6-1\": \"PropTypes.string\\n\\nPut the PropType Description here.\",\n    \"7-1\": \"PropTypes.arrayOf(PropTypes.string)\\n\\nPut the PropType Description here.\",\n    \"8-1\": \"PropTypes.number\\n\\nPut the PropType Description here.\",\n    \"9-1\": \"PropTypes.bool\\n\\nPut the PropType Description here.\",\n    \"2-0\": \"**viroAppProps**\",\n    \"2-1\": \"**PropTypes.object**\\n\\nA javascript object containing properties for this viro app.  One use would be to pass in properties from native if you're using a hybrid applications.\",\n    \"1-0\": \"**onExitViro**\",\n    \"1-1\": \"**PropTypes.func**\\n\\nCalled if the user presses the \\\"X\\\" button to exit.\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Methods\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"Push the given scene onto scene stack, displaying the scene to the user.\\n\\n|Parameters    | Description |        \\n| ------------- |:------------- |\\n|scene    | Scene that will be pushed onto the stack and displayed to the user |\",\n    \"h-0\": \"push(scene: ViroScene)\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"pop()\",\n    \"0-0\": \"Pop the top most scene of the stack, effectively going back to the previous scene.\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"pop(n: number)\",\n    \"0-0\": \"Go back n scenes at once. If n is equal to 1 this is equivalent to calling pop().\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"jump(scene: ViroScene)\",\n    \"0-0\": \"Move to the given scene in the stack, removing it from its current position in the stack and placing it on top, thereby displaying it to the user. If the scene is not already on the stack, this method pushes the scene to the top of the stack, displaying it to the user. This is best used in applications where the user jumps between a set of scenes frequently.\\n\\n|Parameters    | Description |        \\n| ------------- |:------------- |\\n|scene    | Scene that will be moved or pushed to the top of the stack and displayed to the user |\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"Replace the currently displayed scene (the scene at the top of the stack) with the given scene, displaying it to the user. This leaves the remainder of the stack unchanged.\\n\\n|Parameters    | Description |        \\n| ------------- |:------------- |\\n|scene    | Scene that will replace the scene at the top of stack and be displayed to the user |\",\n    \"h-0\": \"replace(scene: ViroScene)\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]","excerpt":"","slug":"viroscenenavigator","type":"basic","title":"ViroSceneNavigator"}

ViroSceneNavigator


A ViroSceneNavigator component is the entry point for VR applications. Please see our [Scene Navigation Guide](scene-navigation) for more information on how to properly navigate between scenes. ######Example use: ``` var MyStartScene = require('./MyStartScene'); import { AppRegistry, ViroScene, ViroSceneNavigator, } from 'react-viro'; var ViroSceneNav = React.createClass({ render: function() { return ( <ViroSceneNavigator initialScene={{ scene: MyStartScene, }} /> ); } }) ``` [block:api-header] { "type": "basic", "title": "Props" } [/block] ##Required Props [block:parameters] { "data": { "h-1": "PropType", "h-0": "PropKey", "0-0": "**apiKey**", "0-1": "**PropTypes.string.isRequired
**
\n\nRequired API Key", "1-0": "**initialScene**", "1-1": "**PropTypes.shape( {scene: PropTypes.func.isRequired
} ),**
\n\nThe initial scene to display for your application on application start." }, "cols": 2, "rows": 2 } [/block] ##Optional Props [block:parameters] { "data": { "0-0": "** debug**", "3-0": "** vrModeEnabled**", "4-0": "**rotation**", "5-0": "**style**", "6-0": "**text**", "7-0": "**transformBehaviors**", "9-0": "**visible**", "8-0": "**width**", "h-0": "PropKey", "h-1": "PropType", "0-1": "**PropTypes.bool**\n\nUsed to enable dev menu on Android Nougat device with Cardboard.", "3-1": "**PropTypes.bool**\n\nCalling vrModeEnabled allows switching to and from VR mode. When set to false, it transitions back to pre-VR (mono) mode. When set to true, we set thie view into a full VR mode. This is set to true by default.", "4-1": "PropTypes.arrayOf(PropTypes.number)\n\nPut the PropType Description here.", "5-1": "stylePropType", "6-1": "PropTypes.string\n\nPut the PropType Description here.", "7-1": "PropTypes.arrayOf(PropTypes.string)\n\nPut the PropType Description here.", "8-1": "PropTypes.number\n\nPut the PropType Description here.", "9-1": "PropTypes.bool\n\nPut the PropType Description here.", "2-0": "**viroAppProps**", "2-1": "**PropTypes.object**\n\nA javascript object containing properties for this viro app. One use would be to pass in properties from native if you're using a hybrid applications.", "1-0": "**onExitViro**", "1-1": "**PropTypes.func**\n\nCalled if the user presses the \"X\" button to exit." }, "cols": 2, "rows": 4 } [/block] [block:api-header] { "type": "basic", "title": "Methods" } [/block] [block:parameters] { "data": { "0-0": "Push the given scene onto scene stack, displaying the scene to the user.\n\n|Parameters | Description | \n| ------------- |:------------- |\n|scene | Scene that will be pushed onto the stack and displayed to the user |", "h-0": "push(scene: ViroScene)" }, "cols": 1, "rows": 1 } [/block] [block:parameters] { "data": { "h-0": "pop()", "0-0": "Pop the top most scene of the stack, effectively going back to the previous scene." }, "cols": 1, "rows": 1 } [/block] [block:parameters] { "data": { "h-0": "pop(n: number)", "0-0": "Go back n scenes at once. If n is equal to 1 this is equivalent to calling pop()." }, "cols": 1, "rows": 1 } [/block] [block:parameters] { "data": { "h-0": "jump(scene: ViroScene)", "0-0": "Move to the given scene in the stack, removing it from its current position in the stack and placing it on top, thereby displaying it to the user. If the scene is not already on the stack, this method pushes the scene to the top of the stack, displaying it to the user. This is best used in applications where the user jumps between a set of scenes frequently.\n\n|Parameters | Description | \n| ------------- |:------------- |\n|scene | Scene that will be moved or pushed to the top of the stack and displayed to the user |" }, "cols": 1, "rows": 1 } [/block] [block:parameters] { "data": { "0-0": "Replace the currently displayed scene (the scene at the top of the stack) with the given scene, displaying it to the user. This leaves the remainder of the stack unchanged.\n\n|Parameters | Description | \n| ------------- |:------------- |\n|scene | Scene that will replace the scene at the top of stack and be displayed to the user |", "h-0": "replace(scene: ViroScene)" }, "cols": 1, "rows": 1 } [/block]