Eptagone / Vite.AspNetCore

Small library to integrate Vite into ASP.NET projects
MIT License
240 stars 33 forks source link

React MVC .NET #91

Open mehradhn opened 8 months ago

mehradhn commented 8 months ago

Hi, can you help me to integrate mvc .net and react. I see this example. this is work but I want to render react inside root of url not /app. when I remove /app my react page render but I cant call controller

Eptagone commented 7 months ago

Hi, you want this? You can render your component wherever you want on any page using:

// File: Assets/example.jsx
const element = document.querySelector('#my-target-element')!;
const root = createRoot(element);
root.render(<MyReactComponent />);