-
-
Notifications
You must be signed in to change notification settings - Fork 173
Description
I've been working on a small "notes" app and encounter the following issue when trying to implement "remove a note with id x
feature". I believe the bug might be more generic than just my notes app (updating state? trigger re-renders?) but this is just an easy way to expose the behaviour.
Node version: v10.15.2
@nodegui/react-nodegui: 0.1.5,
Expected:
Pressing the trash icon next to a note triggers a state changes, returns an array without the given note. Therefore, the note disappears from the screen.
Observed behaviour:
As seen from the console.log
statements, the note correctly disappears from state. Also the "counter" on top correctly reflects the amount of notes is going down by 1. The note itself however does not disappear from remove. Repeated clicks on this or other buttons at some point will just crash the app.
What I've tried
At first I thought it might have to do with passing the callbacks around which might not be supported from some reason. Based on the calculator example I refactored the notes app to useReducer() instead, so state is more centralised and predictable. This didn't seem to make any difference for this bug.
Diff with relevant code changes:
pepf/react-nodegui-starter@08560d5
Reproduction branch:
https://github.com/pepf/react-nodegui-starter/tree/notes-app