I'm trying to create a custom function for objects in Next.js
I'm writting the following
Object.prototype._something = function (something) {
console.log(something)
}
It works, but now it gives me a weird error
Warning: Invalid value for prop `_something` on <img> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM.
But it is only with Object.prototype, if I declare the same function as Array.prototype everything workds fine