I'm creating a React JS project in which I'm using uuid from uuidv4 to generate and use a new uuid per object I'm creating. I'm testing it now and getting the following error:
Uncaught RangeError: Maximum call stack size exceeded
at Object.exports.deprecate (util.js:75:1)
The error is popping up when this method is called. I think it has to do with my use of uuid. Without that line, the app is running without the error.
const addContactHandler = (contact) => {
console.log(contact)
setContacts([...contacts, {id: uuid(), contact}])
};
If anyone has any ideas how I can fix this, any advice would be much appreciated!
I was able to resolve this by using the package react-uuid instead of uuidv4. Otherwise, no code changes were required.