diff --git a/app/preact/package.json b/app/preact/package.json index 6d1fa376c31f..a0731d32dae6 100644 --- a/app/preact/package.json +++ b/app/preact/package.json @@ -44,11 +44,11 @@ "ts-dedent": "^1.1.1" }, "devDependencies": { - "preact": "^8.4.2" + "preact": "^10.4.0" }, "peerDependencies": { "@babel/core": "*", - "preact": "^8.4.2", + "preact": "^10.0.0", "react": "*", "react-dom": "*" }, diff --git a/app/preact/src/client/preview/render.tsx b/app/preact/src/client/preview/render.tsx index 7626371b3241..693b5451270e 100644 --- a/app/preact/src/client/preview/render.tsx +++ b/app/preact/src/client/preview/render.tsx @@ -3,7 +3,6 @@ import { document } from 'global'; import dedent from 'ts-dedent'; import { RenderContext } from './types'; -let renderedStory: Element; const rootElement = document ? document.getElementById('root') : null; export default function renderMain({ storyFn, kind, name, showMain, showError }: RenderContext) { @@ -20,9 +19,9 @@ export default function renderMain({ storyFn, kind, name, showMain, showError }: return; } - render(null, rootElement, renderedStory); + render(null, rootElement); showMain(); - renderedStory = render(element, rootElement); + render(element, rootElement); } diff --git a/yarn.lock b/yarn.lock index 8cec18312dc9..d25ea0e45149 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25815,6 +25815,11 @@ preact-render-to-json@^3.6.6: resolved "https://registry.yarnpkg.com/preact-render-to-json/-/preact-render-to-json-3.6.6.tgz#f67f48581912ac53fc9f4873bc6d7ce342f71c20" integrity sha1-9n9IWBkSrFP8n0hzvG1840L3HCA= +preact@^10.4.0: + version "10.4.4" + resolved "https://registry.yarnpkg.com/preact/-/preact-10.4.4.tgz#0bd6d759ec2f8684aaf8c63c7f076191e46528cf" + integrity sha512-EaTJrerceyAPatQ+vfnadoopsMBZAOY7ak9ogVdUi5xbpR8SoHgtLryXnW+4mQOwt21icqoVR1brkU2dq7pEBA== + preact@^8.4.2: version "8.5.3" resolved "https://registry.yarnpkg.com/preact/-/preact-8.5.3.tgz#78c2a5562fcecb1fed1d0055fa4ac1e27bde17c1"