From 7517db892aa5b7a1e2a384fd0c9ef5a03a33c488 Mon Sep 17 00:00:00 2001 From: Dallas Fraser Date: Thu, 9 Oct 2025 15:54:14 -0400 Subject: [PATCH] fix(issue-324): Re-Hydrate upon remounting after unmounting --- .ts/index.js | 1 + index.js | 1 + src/index.tsx | 1 + 3 files changed, 3 insertions(+) diff --git a/.ts/index.js b/.ts/index.js index 5976a1d..1c0350b 100644 --- a/.ts/index.js +++ b/.ts/index.js @@ -573,6 +573,7 @@ var UnControlled = (function (_super) { if (this.props.editorWillUnmount) { this.props.editorWillUnmount(cm); } + this.hydrated = false; }; UnControlled.prototype.shouldComponentUpdate = function (nextProps, nextState) { var update = true; diff --git a/index.js b/index.js index f82b52f..87e72e3 100644 --- a/index.js +++ b/index.js @@ -607,6 +607,7 @@ var UnControlled = function(_super) { if (this.props.editorWillUnmount) { this.props.editorWillUnmount(cm); } + this.hydrated = false; }; UnControlled.prototype.shouldComponentUpdate = function(nextProps, nextState) { var update = true; diff --git a/src/index.tsx b/src/index.tsx index a021139..435c5a4 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -813,6 +813,7 @@ export class UnControlled extends React.Component if (this.props.editorWillUnmount) { this.props.editorWillUnmount(cm); } + this.hydrated = false; } /** @internal */