Using eslint with React configurations I get an error when using Object.defineProperty
. The error says:
Avoid using
Object.defineProperty
, instead useReflect.defineProperty
. (prefer-reflect)
On the eslint documentation of prefer-reflect they say it's deprecated, the reason being:
The original intent of this rule now seems misguided as we have come to understand that
Reflect
methods are not actually intended to replace theObject
counterparts the rule suggests, but rather exist as low-level primitives to be used with proxies in order to replicate the default behavior of various previously existing functionality.
Then my question is: is there any advantage in using Reflect.defineProperty
instead of Object.defineProperty
?