/** * Entry point for WooCommerce > AI Content Generator. Mounts into the * container printed by WTOFE_Settings_App::render_page(). */ // First, so translations are loaded before anything renders. import '@/lib/i18n'; import { StrictMode } from 'react'; import { createRoot, render } from '@wordpress/element'; import { RouterProvider } from '@tanstack/react-router'; import { router } from './router'; import { watchFieldAnchors } from '@/lib/anchors'; import './styles/index.css'; const container = document.getElementById( 'wtofe-settings-app' ); if ( container ) { watchFieldAnchors(); const app = ( ); // createRoot() came with React 18 in WordPress 6.2; 6.0 and 6.1 only have render(). if ( createRoot ) { createRoot( container ).render( app ); } else { render( app, container ); } }