import React, { useState } from 'react'; import { Button } from 'primereact/button'; import ReactDOM from 'react-dom/client'; import logo from './logo.svg'; const WcTestApp = () => { const [ctr,incr] = useState(0) return (
logo

Edit src/App.js and save to reload.

); } class WcTest extends HTMLElement { connectedCallback() { const mountPoint = this; // to get attributes from outside // const name = this.getAttribute('name'); // ShadowRoot (global styles will not apply, but safer with a complete isolation layer) // this.attachShadow({ mode: 'open' }).appendChild(mountPoint); const root = ReactDOM.createRoot(mountPoint); // render root.render(); } } customElements.define('wc-test', WcTest);