diff --git a/packages/mdx/next.config.js b/packages/mdx/next.config.js index b2774a97..3b8b2704 100644 --- a/packages/mdx/next.config.js +++ b/packages/mdx/next.config.js @@ -1,4 +1,5 @@ module.exports = { + reactStrictMode: true, redirects() { return [ { diff --git a/packages/mdx/src/mini-editor/editor-shift.tsx b/packages/mdx/src/mini-editor/editor-shift.tsx index 0b7b8c18..f09eccb2 100644 --- a/packages/mdx/src/mini-editor/editor-shift.tsx +++ b/packages/mdx/src/mini-editor/editor-shift.tsx @@ -793,21 +793,21 @@ function useSnapshots( useLayoutEffect(() => { if (!prevSnapshot) { - // debugger + const parent = ref.current! setState(s => ({ ...s, prevSnapshot: { - ...getPanelSnapshot(ref.current!, prev), - ...getTabsSnapshot(ref.current!, prev), + ...getPanelSnapshot(parent, prev), + ...getTabsSnapshot(parent, prev), }, })) } else if (!nextSnapshot) { - // debugger + const parent = ref.current! setState(s => ({ ...s, nextSnapshot: { - ...getPanelSnapshot(ref.current!, next), - ...getTabsSnapshot(ref.current!, next), + ...getPanelSnapshot(parent, next), + ...getTabsSnapshot(parent, next), }, })) } diff --git a/packages/mdx/src/smooth-code/copy-button.tsx b/packages/mdx/src/smooth-code/copy-button.tsx index 7209907c..26f82abe 100644 --- a/packages/mdx/src/smooth-code/copy-button.tsx +++ b/packages/mdx/src/smooth-code/copy-button.tsx @@ -43,7 +43,7 @@ export function CopyButton({ )}