diff --git a/app/react-native/src/preview/components/StoryView/index.tsx b/app/react-native/src/preview/components/StoryView/index.tsx index 5b75ecaf7040..83c8576ebffc 100644 --- a/app/react-native/src/preview/components/StoryView/index.tsx +++ b/app/react-native/src/preview/components/StoryView/index.tsx @@ -25,6 +25,16 @@ export default class StoryView extends Component { channel.on(Events.FORCE_RE_RENDER, this.forceReRender); } + componentDidUpdate() { + const channel = addons.getChannel(); + const { stories } = this.props; + const { storyId } = stories.getSelection(); + + if (storyId) { + channel.emit(Events.STORY_RENDERED); + } + } + componentWillUnmount() { const channel = addons.getChannel(); channel.removeListener(Events.STORY_RENDER, this.forceReRender);