dApp: Fix issue with the incorrect order of hooks for ActionFormModal
#454
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on #439
We were getting the error “React detected a change in the order of hooks” when we closed and opened the deposit and withdrawal flow alternately. The problem was that we were calling
renderComponent
directly, even though it is a react component. That causes react to treat the hook calls inside the function as part ofActionFormModal
, even though we meant for them to be part ofStakeFormModal
/UnstakeFormModal
.More info here
UI
Before
Screen.Recording.2024-06-06.at.12.49.12.mov
After
Screen.Recording.2024-06-06.at.13.28.39.mov