diff --git a/app/react-native/src/preview/components/StoryView/index.tsx b/app/react-native/src/preview/components/StoryView/index.tsx index a5448c28ec3b..b7407527aab2 100644 --- a/app/react-native/src/preview/components/StoryView/index.tsx +++ b/app/react-native/src/preview/components/StoryView/index.tsx @@ -77,6 +77,9 @@ export default class StoryView extends Component { } renderListening = () => { + if (!this.state) { + return null; + } const { storyFn, selection } = this.state; const { kind, story } = selection; diff --git a/app/react-native/src/preview/index.tsx b/app/react-native/src/preview/index.tsx index db58db3246a9..8be3979b5078 100644 --- a/app/react-native/src/preview/index.tsx +++ b/app/react-native/src/preview/index.tsx @@ -78,7 +78,7 @@ export default class Preview { channel = new Channel({ async: true }); } else { const host = getHost(params.host || 'localhost'); - const port = params.port ? `:${params.port || 7007}` : ''; + const port = `:${params.port || 7007}`; const query = params.query || ''; const { secured } = params;