Skip to content

Commit

Permalink
fix(preview): reactdom available
Browse files Browse the repository at this point in the history
  • Loading branch information
BJvdA committed Mar 22, 2023
1 parent 2d97aa5 commit aa07c73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@instantcommerce/cli",
"version": "1.3.1",
"version": "1.3.2",
"author": "Instant Commerce B.V.",
"license": "MIT",
"bin": {
Expand Down
9 changes: 7 additions & 2 deletions packages/preview/src/containers/Preview/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import { useEffect, useMemo, useState } from 'react';
import * as React from 'react';
import ReactDOM from 'react-dom/client';
import * as ReactDOM from 'react-dom';
import ReactDOMClient from 'react-dom/client';
import { HelmetProvider } from 'react-helmet-async';

import { getStore } from '../../lib/getStore';
import { BlockRenderer } from './BlockRenderer';
import { Head } from './Head';

window.React = React;
window.ReactDOM = {
...ReactDOM,
...ReactDOMClient,
};

const Preview = () => {
const [error, setError] = useState('');
Expand Down Expand Up @@ -63,4 +68,4 @@ const Preview = () => {
);
};

ReactDOM.createRoot(document.getElementById('root')!).render(<Preview />);
ReactDOMClient.createRoot(document.getElementById('root')!).render(<Preview />);

0 comments on commit aa07c73

Please # to comment.