Closed Roka20012 closed 1 year ago
What are you trying to achieve? Are you trying to open an action sheet with different prop values? you should be able to just use the sheet manager show method to pass through a props payload and then access inside your action sheet component via props.payload.thePropName
What are you trying to achieve? Are you trying to open an action sheet with different prop values? you should be able to just use the sheet manager show method to pass through a props payload and then access inside your action sheet component via props.payload.thePropName
@johnny-mcfadden-dailypay Hello thanks for the response) Basically, I want to open an action sheet, update value in that action sheet on the fly without closing and open it again with other data
Do you know how to achieve this behavior?
Are you looking to:
Yes for example I open the action sheet and need to load some data from API, and update action sheet with this data
@johnny-mcfadden-dailypay
Is this from a user interaction like a button click or an api call that runs when the action sheet opens?
Exactly this one
Can you not just use normal react patters for this? When the api call finishes, update a local state hook inside the action sheet and use the state hook data as your presentational piece. IF you need to initially take in props to the action sheet you could just set this data as your initial state hook value, then override with an api call response.
@johnny-mcfadden-dailypay not sure it will work, but I will give it a try, thanks 👍
Can you not just use normal react patters for this? When the api call finishes, update a local state hook inside the action sheet and use the state hook data as your presentational piece. IF you need to initially take in props to the action sheet you could just set this data as your initial state hook value, then override with an api call response.
having to create separate state to mimic the state controlled outside the action sheet is a very difficult experience, the props.paylaod are not updated on the fly, we literally need to unmount the action sheet and remount it to see state updates.
tldr: anything that gets passed to the sheets as a prop "props.payload" does not re-render the UI in the bottom sheet when updated. You have to close the sheet to see the update that has successful ran.
Hello, @ammarahm-ed first of all thanks for the great package!
I didn't see any mentions of how I can update my payload data in case it's dynamic The only way I ended up with it was to put my queries into ActionSheet and update data dynamically there
I am using SheetManager to manage my ActionSheet
Is there any way to do it or would it be a good feature for this package?
Let me know what you think, please.