Skip to content

Commit

Permalink
fix: make sure not to run polyfill if on web
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyhw committed Sep 17, 2024
1 parent afcce3f commit 738ab83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 0 additions & 3 deletions packages/react-native/babel.config.js

This file was deleted.

5 changes: 3 additions & 2 deletions packages/react-native/src/Start.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Platform } from 'react-native';

// @ts-ignore
if (!URLSearchParams.get) {
if (!URLSearchParams.get && Platform.OS !== 'web') {
// We polyfill URLSearchParams for React Native since URLSearchParams.get is not implemented yet is used in storybook
// with expo this would never run because its already polyfilled
const { setupURLPolyfill } = require('react-native-url-polyfill');
Expand All @@ -19,7 +21,6 @@ import { isExportStory, storyNameFromExport, toId } from '@storybook/csf';
import { createBrowserChannel } from '@storybook/core/channels';
import type { NormalizedStoriesSpecifier, StoryIndex } from '@storybook/core/types';
import type { ReactRenderer } from '@storybook/react';
import { Platform } from 'react-native';
import { View } from './View';

/** Configuration options that are needed at startup, only serialisable values are possible */
Expand Down

0 comments on commit 738ab83

Please sign in to comment.