Skip to content

Commit

Permalink
Merge pull request #18105 from storybookjs/reactDomVersion-undefined-bug
Browse files Browse the repository at this point in the history
React: Fix version detection for older versions of `react-dom`
  • Loading branch information
shilman committed Apr 30, 2022
2 parents 53f5fe8 + 259c2d3 commit ea65ace
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/react/src/client/preview/render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const renderElement = async (node: ReactElement, el: Element) => {
};

const canUseNewReactRootApi =
reactDomVersion.startsWith('18') || reactDomVersion.startsWith('0.0.0');
reactDomVersion && (reactDomVersion.startsWith('18') || reactDomVersion.startsWith('0.0.0'));

const shouldUseNewRootApi = FRAMEWORK_OPTIONS?.legacyRootApi !== true;

Expand Down

0 comments on commit ea65ace

Please sign in to comment.