Undo/Redo calling history() throws "TypeError: Cannot read property '_history' of undefined"
See original GitHub issueCurrent behavior
const {
undo,
redo,
canUndo,
canRedo,
history,
} = useUndo({
nodes,
edges,
onUndoRedo: (state: UndoRedoEvent) => {
console.log('Undo / Redo', state);
setCanvasDataset({
nodes: state?.nodes || [],
edges: state?.edges || [],
});
},
maxHistory: Infinity,
});
console.log('Undo / Redo history', history());
It seems this
is undefined.
history() {
return this._history;
}
The other features and functions works correctly, though. Only history()
is affected.
Expected behavior
Should return the history.
Version
reaflow 3.0.13
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
TypeError: Cannot read property 'history' of undefined
Hi @edgaromar90! I added the code for the /logout path: <Route path="/logout" render={history => { Auth.deauthenticateUser() && history ...
Read more >TypeError: Cannot read property 'history' of undefined #237
I ran across this issue as well and for me it was related to my version of react-router-dom . More specifically, upgrading from...
Read more >Cannot read property 'history' of undefined !! React router ...
Coding example for the question Uncaught TypeError: Cannot read property 'history' of undefined !! React router-Reactjs.
Read more >cannot read properties of null (reading 'children') - You.com
Apparently the error throws here const dots = Array.from(dotsNav.children); //here , though the source of error is coming from previous line.
Read more >Release History for Telerik Products
Virtualized widget cannot set model to selected object; Rendered items does not ... Context menu - is throwing TypeError after use of contextmenu.open()...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
fixed with #117
@amcdnl up, same problem with count()