Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Node, npm versions and dependencies #1052

Merged
merged 13 commits into from
Jan 29, 2024
Prev Previous commit
Next Next commit
Update frontend.jsx to use new React root API
The 'frontend.jsx' file under 'admin-settings' in the assets/js directory now uses the new React root API for rendering. The root API creates a root from a container and allows rendering operations to be scheduled over time. Instead of rendering directly in the component, a constant container is declared and then a root is created from this container for the rendering process.
  • Loading branch information
attackant committed Jan 25, 2024
commit 35ad645b6a71d13973253f9da230f2412be52a08
6 changes: 4 additions & 2 deletions assets/js/admin-settings/frontend.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import ReactDOM from 'react-dom';
// Components.
import AdminSettings from './index';

ReactDOM.render(
const container = document.getElementById('apple-news-options__page');
const root = ReactDOM.createRoot(container);

root.render(
<StrictMode>
<AdminSettings />
</StrictMode>,
document.getElementById('apple-news-options__page'),
);
Loading