DEV Community

Discussion on: Thought on Vue 3 Composition API - `reactive()` considered harmful

Collapse
 
ushironoko profile image
ushironoko

In the option api, each option is self-evident at the top level, making it easy to track reactive data consistently in any code. (This is the biggest advantage of option api)
Since all new APIs are wrapped in setup and reactive data is ejected from the extracted functions, it is not obvious which API the data comes from. By considering .value as a prefix, tracking reactive data can be made somewhat easier.

Collapse
 
smolinari profile image
Scott Molinari

This is why the best practice of using "useXXX" has been suggested. Any object called "useXXX" is considered reactive.

Scott