next.js
ae62138b - remove `draft.isEnabled` setter from exotic draftMode wrappers (#77972)

Commit
1 year ago
remove `draft.isEnabled` setter from exotic draftMode wrappers (#77972) For some reason `createExoticDraftMode[WithDevWarnings]` defines a setter for `draft.isEnabled`. As far as i can tell, this setter is unnecessary. It doesn't seem like we ever allowed this: ```js const draft = await draftMode() draft.isEnabled = false ``` The `DraftMode` class had `isEnabled` as a pure getter from the start, see #49096. You can also see that the previous implementation did the same. (also, the setter wasn't doing anything useful anyway, and arguably was misleading -- it was defining the `isEnabled` property on the promise itself, without actually performing `enable()/disable()`, so i can't see how anyone could be relying on this)
Author
Parents
Loading