fix: update default value for enableWebsockets in View component#890
fix: update default value for enableWebsockets in View component#890ndelangen wants to merge 2 commits into
Conversation
|
There was a problem hiding this comment.
Pull request overview
Updates the React Native Storybook View.getStorybookUI defaults so WebSocket support is enabled automatically when a WebSocket configuration is injected via globalThis.STORYBOOK_WEBSOCKET (e.g., from generated storybook.requires).
Changes:
- Change
enableWebsocketsdefault fromfalsetoBoolean(globalThis.STORYBOOK_WEBSOCKET)inView.getStorybookUI.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| getStorybookUI = (params: Partial<Params> = {}) => { | ||
| const { | ||
| enableWebsockets = false, | ||
| enableWebsockets = !!globalThis.STORYBOOK_WEBSOCKET, | ||
| CustomUIComponent, | ||
| hasStoryWrapper: storyViewWrapper = true, |
There was a problem hiding this comment.
@copilot apply changes based on this feedback
Update the documentation to match the implementation
There was a problem hiding this comment.
Updated the JSDoc in ef76194 — the comment now reads:
default: automatically enabled when a websocket config is injected via storybook.requires (i.e. when STORYBOOK_WS_HOST is set), otherwise false
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>
|
Can you add the changeset? |
What I did
I made the
enableWebsocketsoption auto-enable, based on the generated config runtime.How to test
Provide environment variables for websockets, but don't explicitly setup
enableWebsocketsinside of.rnstorybook/index.tsx.The expected outcome is that the storybook connects to the given websocket address.