避免写嵌套

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. 2017年50道Java线程面试题

    下面是Java线程相关的热门面试题,你可以用它来好好准备面试. 1) 什么是线程? 线程是操作系统能够进行运算调度的最小单位,它被包含在进程之中,是进程中的实际运作单位.程序员可以通过它进行多处理器编 ...

  2. Unity 5.4版本 Application.systemLanguage 失效

    最近在上线双语版本(一个包支持中文.英文二种语言)时,遇到一个坑点 if (ToolUtils.isAndroid()) { if (Application.systemLanguage == Sys ...

  3. 【转】fiddler抓包HTTPS请求

    本文转自:http://blog.csdn.net/idlear/article/details/50999490 fiddler抓包HTTPS请求 跟着教程来,保证100%成功抓HTTPS包 教程开 ...

  4. matplotlib、PIL、cv2图像操作 && caffe / tensorflow 通道顺序

    用python进行图像处理中分别用到过matplotlib.pyplot.PIL.cv2三种库,这三种库图像读取和保存方法各异,并且图像读取时顺序也有差异,如plt.imread和PIL.Image. ...

  5. aspx页面使用ajax遇到try catch中使用Response.End()报错

    1.使用Ajax接收数据,在返回Response.Write()后应该调用Response.End()才能将数据写入到调用的页面,才能被jQuery的回调函数获取到返回的JSON数据 2.在try-- ...

  6. JAVA与C#的区别

    Java和C#都是编程的语言,它们是两个不同方向的两种语言 相同点: 他们都是面向对象的语言,也就是说,它们都能实现面向对象的思想(封装,继承,多态) 区别: 1.c#中的命名空间是namespace ...

  7. mybatis插入一个对象后获取表中自增的主键Id并且传入到插入的的对象中,方便将对象中其他属性赋值给其他以前表主键Id作为非空字段的表

    原本的sql语句为: <insert id="xx" parameterType="com.hrt.partner.model.ShopInsert"&g ...

  8. Linux内核调试方法总结

    Linux内核调试方法总结 一  调试前的准备 二  内核中的bug 三  内核调试配置选项 1  内核配置 2  调试原子操作 四  引发bug并打印信息 1  BUG()和BUG_ON() 2   ...

  9. 推荐系统模型之 FM

    什么是FM模型 FM英文全称是“Factorization Machine”,简称FM模型,中文名“因子分解机”. FM模型其实有些年头了,是2010年由Rendle提出的,但是真正在各大厂大规模在C ...

  10. react学习笔记2之正确使用状态

    //状态不要直接修改,比如: // 错的,这样写不会重新渲染组件 this.state.comment = 'Hello'; //修改状态正确的方式 this.setState({comment:'H ...