https://github.com/chasestarr/react-memento
Step-through and rewind react state transitions
https://github.com/chasestarr/react-memento
Last synced: about 1 month ago
JSON representation
Step-through and rewind react state transitions
- Host: GitHub
- URL: https://github.com/chasestarr/react-memento
- Owner: chasestarr
- Created: 2018-11-05T23:20:08.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-06T01:06:02.000Z (about 7 years ago)
- Last Synced: 2025-02-15T07:07:47.580Z (11 months ago)
- Language: JavaScript
- Size: 102 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## react-memento
Step-through and rewind react state transitions.

```jsx
import React from 'react';
import useMemento from 'react-memento';
function App() {
const [count, setCount, memento] = useMemento(0, 'count');
return (
setCount(count + 1)}>{increment}
{count}
{memento}
);
}
```
`useMemento` maintains a similar api to react's [state hook](https://reactjs.org/docs/hooks-state.html). In addition to the current value, and a setter, it provides a memento component to display the debugger UI. The function also accepts an optional label to identify multiple mementos rendered to the page.
---
unrelated - but i was listening to [this architecture presentation](https://youtu.be/RBlOHFM-ShI?t=1597) by [Neri&Hu](http://www.neriandhu.com) while writing. i was struck by how beautiful the vernacular buildings are in Jiangnan China.
