Jersyfi/react-cookify

Wrong state modification of consentObject

Closed this issue · 1 comments

What is happening?

The state consentObject has a wrong manipulation.
image

Where the error maybe occurs

handleConsentObjectChange()

Changed the handleConsentObjectChange() to fix the state object changing.

From

setConsentObject(prevConsentObject => ({
  ...prevConsentObject,
  newConsentObject
}))

To

setConsentObject(newConsentObject)