避免写嵌套

import { compose } from "recompose";

function Message(props) {
const { classes } = props;
return (
...
);
} const styles = theme => ({
close: {
padding: theme.spacing.unit / 2,
},
}); // @withStyles(styles) @observer class Message ...
export default compose(
withStyles(styles),
observer,
)(Message);

react recompose的更多相关文章

  1. [React] Recompose: Theme React Components Live with Context

    SASS Bootstrap allows us to configure theme or branding variables that affect all components (e.g. P ...

  2. [React] Recompose: Override Styles & Elements Types in React

    When we move from CSS to defining styles inside components we lose the ability to override styles wi ...

  3. [Recompose] Create Stream Behaviors to Push Props in React Components with mapPropsStream

    Rather than using Components to push streams into other Components, mapPropsStream allows you to cre ...

  4. [Recompose] Stream Props to React Children with RxJS

    You can decouple the parent stream Component from the mapped React Component by using props.children ...

  5. [Recompose] Stream a React Component from an Ajax Request with RxJS

    Loading data using RxJS is simple using Observable.ajax. This lesson shows you how to take the ajax ...

  6. [Recompose] Configure Recompose to Build React Components from RxJS Streams

    Recompose provides helper functions to stream props using an Observable library of your choice into ...

  7. [Recompose] Make Reusable React Props Streams with Lenses

    If you hard-code a stream of props to target a specific prop, it becomes impossible to reuse that st ...

  8. [Recompose] Compose Streams of React Props with Recompose’s compose and RxJS

    Functions created with mapPropsStream canned be composed together to build up powerful streams. Brin ...

  9. [Recompose] Handle React Events as Streams with RxJS and Recompose

    Events are the beginning of most every stream. Recompose provides a createEventHandler function to h ...

随机推荐

  1. Go语言排序算法实现

    // Algorithm project Algorithm.go package Algorithm // 冒泡排序 func BubbleSort(a []int) { n := len(a) ; ...

  2. Mac 删除/卸载 自己安装的python

    官网pkg安装的python版本 第一步:删除框架 sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7 1 第二步:删除应用目录 ...

  3. ssh-免密登录批量发送脚本

    1.新建node文件(文件中为需要发送的节点,不能包含主文件服务器) node01 node02 node03 node04 2.ssh的免密登录批处理脚本(需要同级目录下的nodes文件) #!/b ...

  4. 使用python实现深度神经网络 3(转)

    使用python实现深度神经网络 3 快速计算梯度的魔法--反向传播算法 快速计算梯度的魔法--反向传播算法 一.实验介绍 1.1 实验内容 第一次实验最后我们说了,我们已经学习了深度学习中的模型mo ...

  5. NLP 第10章 基于深度学习的NLP 算法

  6. Docker 的插件式设计

    http://www.tuicool.com/articles/MnIRZvJ http://uzhima.com/2016/08/02/what-is-docker-volume-plugin/ 在 ...

  7. 关于用wkwebview加载沙盒documents下html文件 模拟器可以,真机不行的解决方案

    最近也遇到这个问题,把我解决的思路记录一下 1.问题: 用wkwebview加载(loadRequest)沙盒documents下html文件 模拟器可以,真机不行 (前提是html内部含引用外联样式 ...

  8. 分析轮子(九)- Cloneable.java

    注:玩的是JDK1.7版本 一:Cloneable.java 接口也是标记接口,所以,它没有任何方法和属性,实现此接口表示的意思是:可以调用 Object.java 类的 clone() 方法,进行简 ...

  9. NodeJs之fs

    NodeJs版本:4.4.4 fs的实用方法 查看文件信息(fs.stat) 定义:fs.stat(path, callback) var fs = require('fs'); fs.stat('t ...

  10. 如何在宿主机上查看kvm虚拟机的IP

    # arp -a ? (:3c:ce::f2: [ether] on br0 gateway (:c8:ac:d5 [ether] on br0 ? (:d4:fc: [ether] on br0 ? ...