From 218b491c9cefeca68fdc628adfdc60a5b016c4e5 Mon Sep 17 00:00:00 2001 From: llqfront Date: Mon, 26 Sep 2022 18:14:38 +0800 Subject: [PATCH] Update README.md I'm not sure if this is something that exists here, but I'm going to raise it in the hope that it can be answered or replied to --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index a28405a..8f5e481 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,40 @@ npm start ## Start CRA server, then open http://localhost:3001 in your browser npx cra-universal start ``` +#### add StaticRouter +```js +The client uses BrowserRouter or HashRouter but the server needs to use StaticRouter. + +So the app needs to be handled separately, non-ssr go normal app if it is +/server/app.js + +let App = require('../src/server').default; +Needs to be modified separately +Equivalent to a separate app for quoting +eg: +Client. + + + + + +Service side. + + + + + +And one of the apps is available with the redux Provider +so that it can be used + +PS: +There is also an issue that needs to be officially changed + +is that if my normal webpack uses an alias like @ being relative to src . /views/home @/views/home, etc., the alias is not supported when using ssr. + + +``` + ## Production