This function was working properly on react, Now it is not working, could not find a way to fix it.
Moralis.onAccountsChanged( async (accounts) => {
const result =await Moralis.link(accounts[0]);
if (result) {
Router.reload()
}
});
Error
# Unhandled Runtime Error
Error: Cannot add elements to a non-array value
##### Call Stack
###### AddUniqueOp.value
node_modules/moralis/lib/browser/ParseOp.js (466:0)
###### ParseUser.value
node_modules/moralis/lib/browser/ParseObject.js (1202:0)
###### ParseUser.value
node_modules/moralis/lib/browser/ParseObject.js (1392:0)
###### eval