Skip to content

Commit

Permalink
fix: replace ReactDOM.render with createRoot for React 18 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
tolgaOzen committed Jan 24, 2025
1 parent 8991284 commit 8619f78
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Binary file modified playground/public/play.wasm
Binary file not shown.
16 changes: 10 additions & 6 deletions playground/src/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import React from 'react';
import ReactDOM from 'react-dom';
import ReactDOM from 'react-dom/client';
import './_assets/less/index.less';
import App from './App';
import reportWebVitals from './reportWebVitals';
import {LoadWasm} from './wasm';
import { LoadWasm } from './wasm';

ReactDOM.render(
const rootElement = document.getElementById('root');

// Use createRoot instead of render
const root = ReactDOM.createRoot(rootElement);

root.render(
<React.StrictMode>
<LoadWasm>
<App/>
<App />
</LoadWasm>
</React.StrictMode>,
document.getElementById('root')
</React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
Expand Down

0 comments on commit 8619f78

Please sign in to comment.