fix bug in pagination, clean up the approach a bit more

This commit is contained in:
Andrej Karpathy
2021-12-18 23:25:45 -08:00
parent c3cb157c9f
commit 759f7e73e6
4 changed files with 19 additions and 44 deletions
+3
View File
@@ -291,4 +291,7 @@ body {
#link-prev-page, #link-next-page {
margin: 0 5px 0 5px;
font-size: 16px;
cursor: pointer;
color: #009;
text-decoration: underline;
}
+4 -2
View File
@@ -26,5 +26,7 @@ const WordList = props => {
)
}
ReactDOM.render(<WordList words={words} words_desc={words_desc} />,
document.getElementById('wordwrap'));
var elt = document.getElementById('wordwrap');
if(elt) {
ReactDOM.render(<WordList words={words} words_desc={words_desc} />, elt);
}