Skip to content

Commit

Permalink
fix: Refine the fix to storybookjs#219 by forcing a re-render after t…
Browse files Browse the repository at this point in the history
…he fast reload so that the changes get immediately reflected without interaction with the UI.

FORCE_RE_RENDER is a stopgap solution: The UI doesn't seem to re-render even if React.memo is removed from OnDeviceUI.
  • Loading branch information
lauriharpf committed Jul 14, 2021
1 parent dc8eede commit 86cd5cb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/react-native/src/preview/loadCsf.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ClientApi, ConfigApi, StoryStore } from '@storybook/client-api';
import { logger } from '@storybook/client-logger';
import { FORCE_RE_RENDER } from '@storybook/core-events';
import { isExportStory, storyNameFromExport, toId } from '@storybook/csf';
import './global';

Expand Down Expand Up @@ -247,6 +248,7 @@ export const loadCsf = ({
if (m && m.hot) {
storyStore.clearGlobalDecorators();
m.hot.accept();
storyStore._channel.emit(FORCE_RE_RENDER);
}

configApi.configure(loadStories(loadable, framework, { clientApi, storyStore }), m);
Expand Down

0 comments on commit 86cd5cb

Please sign in to comment.