reactjs的css模块化工具"styled-components"升级后injectGlobal废除使用createGlobalStyle代替。 在使用reactjs的css模块化工具"styled-components"的时候报错Attempted import error: 'injectGlobal' is not exported from 'styled-components'。原因是该工具升级后injectGlobal废除使用createGlobalStyle代替。
使用shoulComponentUpdate对子组件的渲染优化 我们在渲染父组件的时候对子组件的render渲染,可以通过shouldComponentUpdate进行优化处理是否需要对子组件进行渲染。