React Inline Styles are Fundamentally Flawed https://byjoeybaker.com/react-inline-styles
参加一个js的会议,大牛正在讲着web component,突然冒出一句react is complete
crap。
大牛还讲了, why it is crap? because it wants to do everything in js. That
is complete nuts.
see the link above to understand yourself.
trying to render the DOM using js is also nuts.
大牛说了in many situations, using the browser native API, for example the
DOM API, and css animations are always the best choices.
by letting the framework to render the DOM for you is total nuts and the
framework is full of pitfalls and flaws.
s*********y 发帖数: 6151
2
So backbone js rules? Even Angular is crab sometimes.
l**********n 发帖数: 8443
3
this is the natural workflow: http://www.phpied.com/rendering-repaint-reflowrelayout-restyle/
What triggers a reflow or a repaint
Anything that changes input information used to construct the rendering tree
can cause a repaint or a reflow, for example:
Adding, removing, updating DOM nodes
Hiding a DOM node with display: none (reflow and repaint) or visibility:
hidden (repaint only, because no geometry changes)
Moving, animating a DOM node on the page
Adding a stylesheet, tweaking style properties
User action such as resizing the window, changing the font size, or (oh, OMG
, no!) scrolling
l**********n 发帖数: 8443
4
those are ok. They don't get rid of the native DOM API.
React completely gets rid of the DOM API, that is why it is total crap.
you should read the article and understand the point.
【在 s*********y 的大作中提到】 : So backbone js rules? Even Angular is crab sometimes.
l**********n 发帖数: 8443
5
一个Java大牛说,java你就不要优化了,优化你也优化不过compiler,react再怎么优
化,也优化不过browser,
Browsers are smart
react比angular恶心一万倍都不止。angular至少还能用jquery操作DOM,到了react,
DOM API被完全禁止了,意味着jquery完全无法使用了,如果mutate DOM using jQuery
,那么就出现这样的bug:
Uncaught Invariant Violation: Unable to find element with ID
而且根本无法debug。
【在 l**********n 的大作中提到】 : react比angular恶心一万倍都不止。angular至少还能用jquery操作DOM,到了react, : DOM API被完全禁止了,意味着jquery完全无法使用了,如果mutate DOM using jQuery : ,那么就出现这样的bug: : Uncaught Invariant Violation: Unable to find element with ID : 而且根本无法debug。
S*******n 发帖数: 305
12
js社区的发展趋势就是 出来一个新轮子,瞬间被捧上天 (特别是大厂出的),然后一堆
人开始写x reasons i like xxx, why I migrate from yyy. 然后过一段时间开始出现
:xxx is anti pattern. why I hate xxx. x reasons I move away from xxx. 然后
新轮子在这中间出现。于是又是 x reasons I like zzz 周而复始,生生不息
W***o 发帖数: 6519
13
大牛对于popularity不算个屌,关键还是看eco system
N*****m 发帖数: 42603
14
同意大牛说的
【在 l**********n 的大作中提到】 : React Inline Styles are Fundamentally Flawed : https://byjoeybaker.com/react-inline-styles : 参加一个js的会议,大牛正在讲着web component,突然冒出一句react is complete : crap。 : 大牛还讲了, why it is crap? because it wants to do everything in js. That : is complete nuts. : see the link above to understand yourself. : trying to render the DOM using js is also nuts. : 大牛说了in many situations, using the browser native API, for example the : DOM API, and css animations are always the best choices.
d*******r 发帖数: 3299
15
确实 XD
【在 S*******n 的大作中提到】 : js社区的发展趋势就是 出来一个新轮子,瞬间被捧上天 (特别是大厂出的),然后一堆 : 人开始写x reasons i like xxx, why I migrate from yyy. 然后过一段时间开始出现 : :xxx is anti pattern. why I hate xxx. x reasons I move away from xxx. 然后 : 新轮子在这中间出现。于是又是 x reasons I like zzz 周而复始,生生不息
The following SVG elements are supported in React.DOM.*:
circle clipPath defs ellipse g image line linearGradient mask path pattern
polygon polyline radialGradient rect stop svg text tspan
l**********n 发帖数: 8443
38
真几把脑残
l**********n 发帖数: 8443
39
真几把脑残,不支持namespace,那怎么实现动画。
Namespace tags are not supported
jsx inline html template 应该属于非常脑残的行为,应该用es6的template literal
l**********n 发帖数: 8443
43
我自己写的代码都觉得恶心:
const getDialogContent = () => {
return _.range(3).map((i) => {
let r = i * 3;
let cells = [1, 2, 3].map((c) => {
let active = (c+r === this.state.selectedCell);
let className = cx(s.tile, { active: active});
return
handleDialogTileClick.bind(this, c + r)} key={c}>{c + r}
})
return (
{cells}
)
})
}
l**********n 发帖数: 8443
44
用js返回html,这也是醉了。
l**********n 发帖数: 8443
45
尼玛这在angular2里这么写:
event)">
l**********n 发帖数: 8443
46
to close a dialog, I have to do this:
handleOpen = () => {
this.setState({open: true});
};
wtf
in angular, I do this:
this.modal.open();
a*******o 发帖数: 290
47
既然你这么讨厌它,就赶紧换回angular。没有人拿枪顶着你用react吧?
【在 l**********n 的大作中提到】 : to close a dialog, I have to do this: : handleOpen = () => { : this.setState({open: true}); : }; : wtf : in angular, I do this: : this.modal.open();