Skip to content
Discussion options

You must be logged in to vote

Using the view's onDisappear to send an action and then do cancellation inside there can be a good way to cancel effects in the child without the parent needing to do anything, but it's only workable if you are not using optional state to drive navigation. If the sheet presents/dismisses based on optional state, then there is a bit of a chicken-and-egg problem.

For example, the state can be nil'd out to represent the sheet should go away, which then a moment later causes onDisappear to fire, but at that point the child reducer can't receive that action because there is no state to reduce on, and hence it can't actually do any cancellation.

So, if you want to go that route you either need …

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
4 replies
@BastianKusserow
Comment options

@tgrapperon
Comment options

@BastianKusserow
Comment options

@tgrapperon
Comment options

Comment options

You must be logged in to vote
3 replies
@BastianKusserow
Comment options

@derekc00
Comment options

@jaroslavas
Comment options

Answer selected by BastianKusserow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants