현재 'ReactJS.NET'을 사용하여 서버 측에서 렌더링 할 수있는 ReactJS (다른 자습서)를 얻으려고합니다.ReactJS.NET을 사용하여 서버 측 렌더링이 실패했습니다.
가 'CommentBox'라는 이름의 구성 요소를 찾을 수 없습니다 :
그러나, 나는 항상 다음과 같은 메시지가 나타납니다. App_Start \ ReactConfig.cs에 추가하는 것을 잊어 버리셨습니까?
코드 here을 보면 매우 직설적 인 것으로 보입니다.
내 ReactConfig.cs : 나는 내가 단순히 설정에 CommentBox.js
및 수행을 생성 (웹팩를 통해) 추가 할 필요가 생각했던 내가 잘못 여기서 뭐하는 거지 점을 볼 수 없습니다
public static class ReactConfig
{
public static void Configure()
{
ReactSiteConfiguration.Configuration
.AddScript("~/Scripts/dist/CommentBox.js");
}
}
.
내보기에서 나는 단지 @Html.React("CommentBox",new {})
을 호출하여 예외가 throw되는 것을 시도합니다. ReactJS.NET 액세스 할 수 있도록
var CommentBox = (function (_super) {
__extends(CommentBox, _super);
function CommentBox() {
return _super !== null && _super.apply(this, arguments) || this;
}
CommentBox.prototype.render = function() {
return __WEBPACK_IMPORTED_MODULE_0_react__["createElement"]("div", { className: "commentBox" },
__WEBPACK_IMPORTED_MODULE_0_react__["createElement"]("h1", null, "Comment-Box"),
__WEBPACK_IMPORTED_MODULE_0_react__["createElement"](CommentForm, null),
__WEBPACK_IMPORTED_MODULE_0_react__["createElement"](CommentList, null));
};
return CommentBox;
}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]));