• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
qiqi105
博客园    首页    新随笔    联系   管理    订阅  订阅
2018年3月26日
react服务端渲染SSR实战
摘要: 使用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)
使用await写异步优化代码
摘要: 使用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)
Provider
摘要: 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)
context的作用
摘要: 看下面的一个简单的组件: 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)
迷你redux实现,redux是如何进行实现的?
摘要: 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服务端渲染原理: 用react生成的app在服务端( node 环境中 )进行渲染,得到完整的html内容,直接返回给浏览器可以呈现的html内容。 阅读全文
posted @ 2018-03-26 09:18 qiqi105 阅读(120) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3