Skip to content

Commit 511bca0

Browse files
ndelangenCopilot
andauthored
fix: update default value for enableWebsockets in View component (#890)
* fix: update default value for enableWebsockets in View component * docs: update enableWebsockets JSDoc to reflect auto-enable behavior Agent-Logs-Url: https://github.com/storybookjs/react-native/sessions/ec11a168-cf2c-46d8-aab4-c390a292e66d Co-authored-by: ndelangen <3070389+ndelangen@users.noreply.github.com> * chore: add changeset for auto-detect websocket enabling in @storybook/react-native --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent e6ee1cb commit 511bca0

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.changeset/slick-ants-double.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@storybook/react-native': patch
3+
---
4+
5+
auto-detect websocket enabling

packages/react-native/src/View.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export type Params = {
9494
hasStoryWrapper?: boolean;
9595
/**
9696
* Enable websockets for the storybook server to remotely control the storybook
97-
* default: false
97+
* default: automatically enabled when a websocket config is injected via storybook.requires (i.e. when STORYBOOK_WS_HOST is set), otherwise false
9898
*/
9999
enableWebsockets?: boolean;
100100
query?: string;
@@ -264,7 +264,7 @@ export class View {
264264

265265
getStorybookUI = (params: Partial<Params> = {}) => {
266266
const {
267-
enableWebsockets = false,
267+
enableWebsockets = !!globalThis.STORYBOOK_WEBSOCKET,
268268
CustomUIComponent,
269269
hasStoryWrapper: storyViewWrapper = true,
270270
} = params;

0 commit comments

Comments
 (0)