mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Add react tag helper. Clean up code and make it more consistent.
This commit is contained in:
@@ -1,24 +1,12 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNet.NodeServices;
|
||||
using Microsoft.AspNet.NodeServices.React;
|
||||
|
||||
namespace ReactExample.Controllers
|
||||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
private INodeServices nodeServices;
|
||||
|
||||
public HomeController(INodeServices nodeServices) {
|
||||
this.nodeServices = nodeServices;
|
||||
}
|
||||
|
||||
public async Task<IActionResult> Index(int pageIndex)
|
||||
public IActionResult Index(int pageIndex)
|
||||
{
|
||||
ViewData["ReactOutput"] = await ReactRenderer.RenderToString(this.nodeServices,
|
||||
moduleName: "ReactApp/components/ReactApp.jsx",
|
||||
baseUrl: Request.Path
|
||||
);
|
||||
return View();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user