-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install packages for React, create ReactController #901
Conversation
15e559d
to
d1e4a21
Compare
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"react-i18next": "^11.11.0", | ||
"react-overlays": "^5.1.0", | ||
"react-router-dom": "^6.0.0-beta.0", | ||
"react-transition-group": "^4.4.2", | ||
"react-use": "^17.2.4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<remikus path="/bundles/manifest.js" /> | ||
<remikus path="/bundles/vendor.js" /> | ||
<remikus path="/bundles/index.js" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Powered by ReMikus. :)
</head> | ||
<body class="vdb"> | ||
<div id="app"></div> | ||
<script>window.vdb = @ToJS(new { Values = new GlobalValues(this) })</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The vdb
global variable is used to pass data from backend to frontend. This variable is initialized only once, when the page is first loaded. See also the GlobalValues class.
@@ -0,0 +1,43 @@ | |||
@using System.Globalization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: Some features in this file are not yet implemented.
@@ -370,6 +370,8 @@ void HandleHttpError(int code, string? description = null, string? msg = null) | |||
endpoints.MapControllerRoute( | |||
name: "default", | |||
pattern: "{controller=Home}/{action=Index}/{id?}"); | |||
|
|||
endpoints.MapFallbackToController(action: "Index", controller: "React"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ReactController
controller will handle requests to the React app, which will simply serve the single page in the React app.
First step towards #900.