fix: text/link hydration bug (#5629)

This commit is contained in:
Sébastien Lorber 2021-09-30 18:54:40 +01:00 committed by GitHub
parent 09550b0535
commit 9d129631b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 1 deletions

View file

@ -133,7 +133,7 @@ async function doRender(locals) {
try {
// Minify html with https://github.com/DanielRuf/html-minifier-terser
return await minify(renderedHtml, {
removeComments: true,
removeComments: false,
removeRedundantAttributes: true,
removeEmptyAttributes: true,
removeScriptTypeAttributes: true,

View file

@ -0,0 +1,31 @@
import React from 'react';
import Layout from '@theme/Layout';
// Repro for hydration issue https://github.com/facebook/docusaurus/issues/5617
function BuggyText() {
return (
<span>
Built using the{' '}
<a href="https://www.electronjs.org/" target="_blank">
Electron
</a>{' '}
, based on{' '}
<a href="https://www.chromium.org/" target="_blank">
Chromium
</a>
, and written using{' '}
<a href="https://www.typescriptlang.org/" target="_blank">
TypeScript
</a>{' '}
, Xplorer promises you an unprecedented experience.
</span>
);
}
export default function Home() {
return (
<Layout>
<BuggyText />
</Layout>
);
}