I saw a lot of questions on how to clear a field value and I also needed the answer myself until creating this workaround. It may or may not work for all use cases but I wanted to share and see other developers’ input.
I’m building a social app. For each new post, I’m associating different post actions (i.e. moods, tagged friends, goals, etc.). I kept running into the issue of clearing fields after the post was created. So instead I rearranged the actions as follows:
Old Flow:
Click Button from Homepage
go to screen “New Post” screen
Click button from “New Post” screen
create post
New Flow:
Click Button from Homepage
Create new post
go to screen “New Post” with Newly created post data associated
Click button from “New Post” screen
update current post
Using this method, you don’t need to “clear fields” at all. For the “cancel” button I added the action to delete the current post and link back to the previous screen.
Interested in hearing if anyone has done something similar or if you think this will help your use case