-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor, describe
window < 599px
issue
- Loading branch information
1 parent
f3b2db7
commit e440532
Showing
10 changed files
with
1,352 additions
and
146 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
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
This file was deleted.
Oops, something went wrong.
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,20 +1,22 @@ | ||
import Link from "next/link"; | ||
import DataTable from "react-data-table-component"; | ||
import ReactMarkdown from "react-markdown"; | ||
import fs from "fs"; | ||
|
||
export default function Index() { | ||
const rdtc = <a target={"_blank"} href={"https://github.com/jbetancur/react-data-table-component"}>react-data-table-component</a> | ||
const DataTable = <a href={"https://github.com/jbetancur/react-data-table-component/blob/v7.6.2/src/DataTable/DataTable.tsx"}>DataTable</a> | ||
return ( | ||
<div> | ||
<h1><a target={"_blank"} href={"https://github.com/runsascoded/react-data-table-hydration-bug"}>react-data-table-hydration-bug</a></h1> | ||
<p>Repro of a hydration error in {rdtc}'s pagination <code><nav></code> element:</p> | ||
<ul> | ||
<li><Link href={"/hydration-error"}>/hydration-error</Link>: hydration error while rendering a simple {rdtc} {DataTable}</li> | ||
<li><Link href={"/no-pagination-no-error"}>/no-pagination-no-error</Link>: commenting out the `pagination` property doesn't exhibit have the issue</li> | ||
</ul> | ||
<p>Both pages above have been compiled, so you'll have to open the dev console to see the error</p> | ||
<p>Cloning the repo and running <code>next dev</code> allows for more context:</p> | ||
<p><a href={"/hydration-error.png"}><img width={800} src={"/hydration-error.png"}/></a></p> | ||
<p>See <a target={"_blank"} href={"https://github.com/runsascoded/react-data-table-hydration-bug"}>runsascoded/react-data-table-hydration-bug</a> on Github for more info.</p> | ||
</div> | ||
) | ||
export function getStaticProps() { | ||
return { props: { readme: fs.readFileSync("README.md").toString() } } | ||
} | ||
|
||
const Index = ({ readme }: { readme: string }) => | ||
<div className={"markdown-body"}> | ||
<ReactMarkdown>{readme}</ReactMarkdown> | ||
<hr /> | ||
<DataTable | ||
columns={[ { name: "Str" }, { name: "Num" } ]} | ||
data={[ { Str: "A", Num: 1 } ]} | ||
// This line causes a hydration error in the pagination footer "nav" element (iff the | ||
// browser window is ≥599px wide); commenting this line fixes it. | ||
pagination | ||
/> | ||
</div> | ||
|
||
export default Index |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.