Code Monkey home page Code Monkey logo

react-koa2-ssr's Issues

服务器端怎么部署

server文件夹下面的文件里面还有引用src源码的组件,要上线,服务端怎么部署呢?

Is is possible to use localStorage before rendering in browser?

I use token to authenticate users. It just like the following code

if(localStorage.jwtToken) {
      setAuthorizationToken(localStorage.jwtToken);
      try {
          store.dispatch(setCurrentUser(jwtDecode(localStorage.jwtToken)));
      } catch (err) {
          store.dispatch(setCurrentUser({}));
      }
  }

But localStorage is not available in node environment where inside renderToString function.

Any possible solution for this?

babel 的 preset 配置是不是冗余了

`
{
"presets": ["react", "es2015", "stage-0", "stage-1", "stage-2", "stage-3"],
"plugins": ["transform-runtime"]
}

`
stage-0已经包含(stage-1,stage-2,stage-3)

BrowserRouter路径怎么重定向啊

按照你的说法,我自己搭建了一个没有Provider只有StaticRouter这种的,但是根路径是可以的,只要换路径,刷新页面,就Internal Server Error
控制台报错为:Error: Invariant failed: Browser history needs a DOM

请问怎么解决的,项目跟你的差不多,就是没有redux这些

npm run server时首次进入是否渲染了两次?

第一次是后端返回的字符串,第二次是客户端渲染的html。因为我看到首次进入显示的页面源代码时,显示的与未启用服务端渲染时完全一致。
-------仔细看了下 是由于开启了servicework

SSR

你好 用rendertostring只能出空白的页面 怎么配合axios取初始数据呢 看了很多例子都没有搞明白 我的理解是rendertostring之前 再sever.js里面用axios取一起数据库数据然后保存到state里面 还是应该在别的地方取数据?

ssr+spa混合?

想请问下,这个是首屏服务端渲染,后面的都是客户端渲染吗?
因为我看到使用了react-router

如果做部分同构直出呢?

我觉得这个架子很棒,有关于部分同构直出的方案吗?希望一部分静态页面直出,部分还是前端渲染,只是通过中间层加装数据后直出给它。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.