ustccjw
ustccjw
@rockcoder23 我是觉得组件的规模尽可能小,基于结构就可以控制样式。 > 组件的根节点使用 custom tag(唯一标识组件),内部样式使用标签结构选择器来定制(不使用 className),外面包一层根节点 tag(用来保证 CSS 局域化)。 在实践中,我发现这样做的好处是让你能够自觉地拆分组件,而且生成的 DOM 结构更加语义化。
How about use **custom-tag** and **structure of the selector** to define style: - Component use **custom-tag** as the root, each component has a unique tag. - Using **custom-tag** as css-wrap...
@nikgraf ``` export default class ArticleList extends React.Component { render() { const { articles } = this.props const articleComponents = articles.map(article => ) return ( {articleComponents} ) } } ```...
@pixelass `when Orientation/Position/Size has been changed by props,component will change the Orientation/Position/Size state` - this is my need.
@paranoidjk [email protected] 没使用 babel-runtime 和最新版本可以做比较,不一定是引入冗余代码,只是 core-js 导致体积变大
@paranoidjk 你这个估计模块很少,所以看起来特别显著。不过移动端的项目一般 bundle 不会太大,所以还是有影响的。