Create full-page React admin interfaces inside wp-admin. No iframe, native WordPress integration.
Set "admin.page": true in your module.json to tell the Hub your module needs an admin page. The Hub registers the menu item and enqueues your assets automatically.
{
"slug": "dashboard",
"admin": {
"page": true,
"menu_title": "Dashboard",
"menu_icon": "dashicons-chart-area",
"position": 30
}
}Place your React app in assets/admin.tsx. The Hub takeover system mounts it in a full-page container inside wp-admin — no iframe, full CSS control, access to the WordPress REST API.
import { createRoot } from 'react-dom/client';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { App } from './components/app';
const queryClient = new QueryClient();
const root = createRoot(
document.getElementById('meteorack-module-root')!
);
root.render(
<QueryClientProvider client={queryClient}>
<App />
</QueryClientProvider>
);Use Vite to build your React app. The Hub expects compiled assets in assets/dist/. Add a vite.config.ts at your module root.
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
build: {
outDir: 'assets/dist',
rollupOptions: {
input: 'assets/admin.tsx',
output: {
entryFileNames: 'admin.js',
assetFileNames: 'admin.css',
},
},
},
});