正在加载视频...

视频加载失败

Following the "React is more 'pure' than Vue" issue, I made this comparison where we can see that Vue's JS style is closer to Vanilla JS behavior than React's JS style.

513,352 次观看 • 3 年前 •via X (Twitter)

9 条评论

:icarus.gk ⇏ ▿ 的头像
:icarus.gk ⇏ ▿3 年前

@reactjs I made the nefarious mistake of not including the cleanup for the Vue component, thinking it would be implicit, but mostly show how easy is to get things running on Vue for someone new to the framework. But I guess the bug at first glance is the only thing left to pick on.

marc 🦀 的头像
marc 🦀3 年前

@vuejs @reactjs 1-When will the vue setInterval stop? 2- The react setInterval will stop when the component unmounts 3-You don't need "count" as dependency in the useEffect

:icarus.gk ⇏ ▿ 的头像
:icarus.gk ⇏ ▿3 年前

@vuejs @reactjs 1. It will keep accumulating on changes until you close the tab. However, to keep things concise and emphasize how close Vue's JS style is and how beginner-friendly it is to have this JS functionality out of the box, I omitted this detail. Here's how you can stop the interval:

:icarus.gk ⇏ ▿ 的头像
:icarus.gk ⇏ ▿3 年前

@reactjs Me with React devs because I forgot to clean the interval:

chriscerie 的头像
chriscerie3 年前

@vuejs @reactjs This is a borderline bait post. When using a library incorrectly I’d much rather errors be obvious than be subtle and seemingly work until it doesn’t

:icarus.gk ⇏ ▿ 的头像
:icarus.gk ⇏ ▿3 年前

@vuejs @reactjs It was a post to show how easy it is for someone new into frameworks how much friendlier and "pure" Vue is. I made the buggy interval example for the same reason. If you know about intervals, you know about clearing them, but it could be a wrong assumption from me.

Mirza 的头像
Mirza3 年前

@vuejs @reactjs That "clean" Vue code actually contains a bug. Fix it, then compare.

César Gómez 的头像
César Gómez3 年前

@vuejs @reactjs Hell no, why React devs want to tryharding their lifes with this?

:icarus.gk ⇏ ▿ 的头像
:icarus.gk ⇏ ▿3 年前

@vuejs @reactjs I honestly don't know 🫣

相关视频

Baba Rex js really sick 😂 what kind of s3x style is this?
0:55

Sensitive content

Baba Rex js really sick 😂 what kind of s3x style is this?

Naomi

12,961 次观看 • 1 个月前