State change not triggering a re-render in React? #4733
Unanswered
amerfarooq
asked this question in
Q&A
Replies: 1 comment 6 replies
-
Please prepare this in a runnable form - using Stackblitz or CodeSandbox (or at least a cloneable repository) and please list the exact steps to reproduce the issue using the provided repro. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've started using the xstate library recently and I am failing to understand why a state change in my machine is not triggering a re-render when using the
useMachine
hook. I'm very new to this so I apologize if this is very basic but I couldn't understand how to go about doing it. This is my current code (using NextJs 14):page.tsx:
renderer.tsx:
state-machine.tsx:
current-address-step.tsx:
The problem I'm facing is that when I submit my form, I can see the logs which show me that the state has changed to
onCurrentResidence
but myRenderer
component does not pick up this state change and hence does not render the next step component. How do I listen for this change?Beta Was this translation helpful? Give feedback.
All reactions