Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions stories/useStateWithHistory.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const Demo = () => {
return;
}

window.history.back(stepSize);
history.back(stepSize);
},
[history, stepSize]
);
Expand All @@ -35,7 +35,7 @@ const Demo = () => {
return;
}

window.history.forward(stepSize);
history.forward(stepSize);
},
[history, stepSize]
);
Expand All @@ -60,12 +60,12 @@ const Demo = () => {
Current state: <span>{state}</span>
</div>
<div style={{ marginTop: 8 }}>
<button onClick={handleBackClick} disabled={!window.history.position}>
<button onClick={handleBackClick} disabled={!history.position}>
&lt; Back
</button>
<button
onClick={handleForwardClick}
disabled={window.history.position >= window.history.window.history.length - 1}>
disabled={history.position >= history.history.length - 1}>
Forward &gt;
</button>
&nbsp; Step size:&nbsp;
Expand All @@ -76,7 +76,7 @@ const Demo = () => {
<div>Current history</div>
<div
dangerouslySetInnerHTML={{
__html: JSON.stringify(window.history.history, null, 2)
__html: JSON.stringify(history.history, null, 2)
.replace(/\n/g, '<br/>')
.replace(/ /g, '&nbsp;'),
}}
Expand Down