ReactJS server side rendering module for Orchard CMS
- Install React.Core by command
install-package React.Core -version 5.0.0
- Include built bundle script in ShellEvent. For example:
namespace Codesanook.Module {
public class ShellEvent : IOrchardShellEvents {
public void Activated() {
ReactSiteConfiguration.Configuration
// Disable load Babel because we already transformed TypeScript with Webpack
.SetLoadBabel(false)
.AddScriptWithoutTransform(
"~/Modules/Codesanook.Module/Scripts/codesanook-module.js"
);
}
public void Terminating() {
}
}
}
- Add
<add namespace="Codesanook.ReactJS" />
to<system.web.webPages.razor>
in Web.config root level. - Add
Script.Require("React").AtHead()
andScript.Require("ReactDOM").AtHead()
. - Include a bundle script in a module's Razor page with
Script.Include("bundle.js")
. - Add
HtmlHelper.React("Module.Component", {Props})
. - Add
@Html.ReactInitJavaScript()
at bottom of Document.cshtml (theme) of an active theme to initialize React script.
- ClearScriptV8-32.dll
- v8-base-ia32.dll
- v8-ia32.dll
- v8-libcpp-ia32.dll