摘要:
使用babel-node代替node让node支持es6语法; //react服务端渲染SSR实战//使用babel-node让node支持es6语法//node上支持css,用的是css-modules-require-hook//解决图片问题:asset-require-hookimport { 阅读全文
posted @ 2018-03-26 17:17
qiqi105
阅读(790)
评论(0)
推荐(0)
摘要:
使用promise: function readMsg(){ return dispatch=>{ axios.post('/msgList').then(res=>{ console.log(res.data) }) }} 使用async+await: function readMsg(){ re 阅读全文
posted @ 2018-03-26 16:12
qiqi105
阅读(709)
评论(0)
推荐(0)
摘要:
import React from 'react';import PropTypes from 'prop-types'; class Provider extends React.Component { static childContextTypes = { store:PropsTypes.o 阅读全文
posted @ 2018-03-26 15:09
qiqi105
阅读(253)
评论(0)
推荐(0)
摘要:
看下面的一个简单的组件: import React from 'react' class Sidebar extends React.Component { render(){ return(<div> <p>我是Sidebar</p> <ul> <li> <Navbar user={this.pr 阅读全文
posted @ 2018-03-26 15:01
qiqi105
阅读(376)
评论(0)
推荐(0)
摘要:
export function createStore(reducer){ let currentState={} let currentListeners=[] function getState(){ return currentState } function subscribe(listen 阅读全文
posted @ 2018-03-26 14:27
qiqi105
阅读(145)
评论(0)
推荐(0)
摘要:
react服务端渲染原理: 用react生成的app在服务端( node 环境中 )进行渲染,得到完整的html内容,直接返回给浏览器可以呈现的html内容。 阅读全文
posted @ 2018-03-26 09:18
qiqi105
阅读(120)
评论(0)
推荐(0)
浙公网安备 33010602011771号