-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b774bc
commit 5e643c2
Showing
3 changed files
with
110 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
const withTM = require("next-transpile-modules")(["ui"]); | ||
const { env } = require("./server/env"); | ||
|
||
module.exports = withTM({ | ||
reactStrictMode: true, | ||
publicRuntimeConfig: { | ||
NODE_ENV: env.NODE_ENV, | ||
}, | ||
experimental: { images: { allowFutureImage: true } }, | ||
}); | ||
module.exports = withTM( | ||
/** | ||
* @type {import('next').NextConfig} | ||
*/ | ||
{ | ||
reactStrictMode: true, | ||
publicRuntimeConfig: { | ||
NODE_ENV: env.NODE_ENV, | ||
}, | ||
experimental: { images: { allowFutureImage: true, esmExternals: true } }, | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
diff --git a/node_modules/@tiptap/react/dist/tiptap-react.cjs.js b/node_modules/@tiptap/react/dist/tiptap-react.cjs.js | ||
index 1ef7c04..43df405 100644 | ||
--- a/node_modules/@tiptap/react/dist/tiptap-react.cjs.js | ||
+++ b/node_modules/@tiptap/react/dist/tiptap-react.cjs.js | ||
@@ -192,11 +192,13 @@ class ReactRenderer { | ||
}; | ||
} | ||
this.reactElement = React__default["default"].createElement(Component, { ...props }); | ||
- if ((_a = this.editor) === null || _a === void 0 ? void 0 : _a.contentComponent) { | ||
- this.editor.contentComponent.setState({ | ||
- renderers: this.editor.contentComponent.state.renderers.set(this.id, this), | ||
- }); | ||
- } | ||
+ ReactDOM.flushSync(() => { | ||
+ if ((_a = this.editor) === null || _a === void 0 ? void 0 : _a.contentComponent) { | ||
+ this.editor.contentComponent.setState({ | ||
+ renderers: this.editor.contentComponent.state.renderers.set(this.id, this), | ||
+ }); | ||
+ } | ||
+ }); | ||
} | ||
updateProps(props = {}) { | ||
this.props = { | ||
@@ -206,14 +208,16 @@ class ReactRenderer { | ||
this.render(); | ||
} | ||
destroy() { | ||
- var _a; | ||
- if ((_a = this.editor) === null || _a === void 0 ? void 0 : _a.contentComponent) { | ||
- const { renderers } = this.editor.contentComponent.state; | ||
- renderers.delete(this.id); | ||
- this.editor.contentComponent.setState({ | ||
- renderers, | ||
- }); | ||
- } | ||
+ ReactDOM.flushSync(() => { | ||
+ var _a; | ||
+ if ((_a = this.editor) === null || _a === void 0 ? void 0 : _a.contentComponent) { | ||
+ const { renderers } = this.editor.contentComponent.state; | ||
+ renderers.delete(this.id); | ||
+ this.editor.contentComponent.setState({ | ||
+ renderers, | ||
+ }); | ||
+ } | ||
+ }); | ||
} | ||
} | ||
|
||
diff --git a/node_modules/@tiptap/react/dist/tiptap-react.esm.js b/node_modules/@tiptap/react/dist/tiptap-react.esm.js | ||
index 505e75a..d3a89dd 100644 | ||
--- a/node_modules/@tiptap/react/dist/tiptap-react.esm.js | ||
+++ b/node_modules/@tiptap/react/dist/tiptap-react.esm.js | ||
@@ -184,11 +184,13 @@ class ReactRenderer { | ||
}; | ||
} | ||
this.reactElement = React.createElement(Component, { ...props }); | ||
- if ((_a = this.editor) === null || _a === void 0 ? void 0 : _a.contentComponent) { | ||
- this.editor.contentComponent.setState({ | ||
- renderers: this.editor.contentComponent.state.renderers.set(this.id, this), | ||
- }); | ||
- } | ||
+ ReactDOM.flushSync(() => { | ||
+ if ((_a = this.editor) === null || _a === void 0 ? void 0 : _a.contentComponent) { | ||
+ this.editor.contentComponent.setState({ | ||
+ renderers: this.editor.contentComponent.state.renderers.set(this.id, this), | ||
+ }); | ||
+ } | ||
+ }); | ||
} | ||
updateProps(props = {}) { | ||
this.props = { | ||
@@ -198,14 +200,16 @@ class ReactRenderer { | ||
this.render(); | ||
} | ||
destroy() { | ||
- var _a; | ||
- if ((_a = this.editor) === null || _a === void 0 ? void 0 : _a.contentComponent) { | ||
- const { renderers } = this.editor.contentComponent.state; | ||
- renderers.delete(this.id); | ||
- this.editor.contentComponent.setState({ | ||
- renderers, | ||
- }); | ||
- } | ||
+ ReactDOM.flushSync(() => { | ||
+ var _a; | ||
+ if ((_a = this.editor) === null || _a === void 0 ? void 0 : _a.contentComponent) { | ||
+ const { renderers } = this.editor.contentComponent.state; | ||
+ renderers.delete(this.id); | ||
+ this.editor.contentComponent.setState({ | ||
+ renderers, | ||
+ }); | ||
+ } | ||
+ }); | ||
} | ||
} | ||
|