Skip to content

fix: replace deprecated ReactDOM.render with createRoot API - #99

Open
AliMahmoudDev wants to merge 1 commit into
deepsonK:mainfrom
AliMahmoudDev:fix/deprecated-reactdom-render
Open

AliMahmoudDev wants to merge 1 commit into
deepsonK:mainfrom
AliMahmoudDev:fix/deprecated-reactdom-render

Conversation

@AliMahmoudDev

Copy link
Copy Markdown

What this PR does

Replaces the deprecated ReactDOM.render with the modern createRoot API from React 18+.

Changes

  • Replaced ReactDOM.render() with createRoot().render()
  • Added null check for root container with helpful error message
  • Wrapped in React.StrictMode for development warnings
  • This fixes the deprecation warning shown in the console

Closes #16

Before

ReactDOM.render(<App />, document.getElementById('root'));

After

const root = createRoot(document.getElementById('root'));
root.render(<App />);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix deprecated ReactDOM.render in index.js

1 participant