《CSSinDepth》pdf下载在线阅读,求百度网盘云资源

html-css018

《CSSinDepth》pdf下载在线阅读,求百度网盘云资源,第1张

《CSS in Depth》(Keith J. Grant)电子书网盘下载免费在线阅读

链接:https://pan.baidu.com/s/1DxOOcB_1_zWX5eqyd93MIA

密码:cfnv  

书名:CSS in Depth

作者:Keith J. Grant

豆瓣评分:8.4

出版社:Manning Publications

出版年份:2017-3-31

页数:500

内容简介:

Cascading Style Sheets, better known as CSS, is one of the foundational technologies that drives the Web. CSS lets you precisely specify the visual design of a web page or web app, from the structural layout of elements on the page to their individual look and feel. If you are like most web developers, you know just enough CSS to get by. You can do basic styling and layout, but you often run into roadblocks. If you know CSS, but you don't really know CSS, this is the book for you.

CSS in Depth takes web developers from beginner to advanced CSS users, getting rid of their blind spots along the way. In this book, you'll revisit concepts you are likely familiar with but have not completely mastered. You'll also encounter advanced subjects, like transitions and animations, as well as brand new ideas, like flexbox and grid layout. You'll start by going deep into the essentials of CSS while you get practical advice to help you maintain control over your styles. Next, you'll dive deep into layout topics and learn to tackle common pitfalls. Then you'll focus on organizing your code and dealing with CSS at scale. The last part of this book explains more advanced techniques the average developer probably hasn't worked with, like transitions, animations, and transformations, as well as practical design skills: how to choose colors and typography so your page or app is pleasing to look at and use.

作者简介:

Keith J. Grant is a Senior Web Developer at Intercontinental Exchange, Inc. (ICE), where he wrote and maintains the CSS for the corporate websites, including The New York Stock Exchange site. He has many years of professional experience building and maintaining web applications and web sites using HTML, CSS, and JavaScript.

componentDidUpdate 是更新版的 componentDidMount 方法。在这里可以处理本地的UI元素,可以操作 refs ,有需要的话也可以开启另外一个绘制过程。

componentDidUpdate 方法会传入两个参数: prevProps , prevState 。这个正好和 componentWillUpdate 是相对的。这个两个参数的值就是在方法调用之前的 this.props 和 this.state 。

就如同 componentDidMount , componentDidUpdate 在所有的子组件都更新之后被调用。如上图, A.0.0 的 componentDidUpdate 会先调用,然后是 A.0 的,最后才是 A 的。

使用 componentDidUpdate 最一般的情况就是管理第三个的UI组件,以及和本地UI元素交互。比如你使用了Chart库之后:

在数据发横变化之后,更新图表

我们也可以查找本地的UI元素、获取大小和css的样式等。我们可以更新子组件。这时,可以调用 this.setState 或者 forceUpdate 。但是,这样也会引起很多的其他问题。

最糟糕的问题就是在没有检查条件的情况下直接调用 setState 方法:

默认情况下 shouldComponentUpdate 方法返回的是 true 。所以,如果我们用了上面的方法,我们会进入无限循环的状态。

总的来说,一般不需要这么做。而且这样的重绘会造成性能问题。

原文地址: https://developmentarc.gitbooks.io/react-indepth/content/life_cycle/update/postrender_with_componentdidupdate.html