Why does Vue3 recommend using ref instead of reactive?

reactive itself has great limitations, which requires extra attention during use. If these problems are ignored, it will cause a lot of trouble in development; ref is more like the option api in the vue2 era The replacement of data can store any data type, while the data type declared by reactive can only be objects;

Let’s draw the conclusion first, and then explain the reason in detail: Don’t use reactive unless necessary! (Official documents also have corresponding recommendations)

Official text: It is recommended to use ref() as the main API for declaring reactive status.

The people who know Vue best have said this: Recommended ref!!!!!!

reactive and ref comparison

reactive ref
?Only supports objects and arrays (reference data types) ?Supports basic data types + reference data types
?In in code>