Skip to content

Commit

Permalink
Merge pull request #3686 from storybooks/disableWebsockets
Browse files Browse the repository at this point in the history
using disableWebsockets instead of useWebsockets
  • Loading branch information
Hypnosphi authored May 31, 2018
2 parents fb6fb1d + 5566866 commit 44e29aa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions app/react-native/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,28 @@ The following parameters can be passed to the start command:
Override the root(s) to be used by the packager
```

## getStorybookUI Options

You can pass these parameters to getStorybookUI call in your storybook entry point:

```
{
onDeviceUI: Boolean (false)
-- display stories list on the device
disableWebsockets: Boolean (false)
-- allows to display stories without running storybook server. Should be used with onDeviceUI
secured: Boolean (false)
-- use wss/https instead of ws/http
host: String (NativeModules.SourceCode.scriptURL)
-- host to use
port: Number (7007)
-- port to use
query: String ("")
-- additional query string to pass to websockets
}
```


## Learn More

Check the `docs` directory in this repo for more advanced setup guides and other info.
2 changes: 1 addition & 1 deletion app/react-native/src/preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class Preview {
}

if (!channel || params.resetStorybook) {
if (params.onDeviceUI && !params.useWebsockets) {
if (params.onDeviceUI && params.disableWebsockets) {
channel = new EventEmitter();
} else {
const host = params.host || parse(NativeModules.SourceCode.scriptURL).hostname;
Expand Down

0 comments on commit 44e29aa

Please # to comment.