Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useDialogs Make Payload a Node Rather than a String #4336

Open
aress31 opened this issue Oct 29, 2024 · 2 comments
Open

useDialogs Make Payload a Node Rather than a String #4336

aress31 opened this issue Oct 29, 2024 · 2 comments
Assignees
Labels
docs Improvements or additions to the documentation scope: toolpad-core Abbreviated to "core"

Comments

@aress31
Copy link

aress31 commented Oct 29, 2024

Summary

The dialog payload specifies that payload is expected to be of type string, which feels restrictive. For example, my use case involves passing a complex form as the payload. Expanding support to allow any type of payload would be highly beneficial.

Examples

No response

Motivation

Extending the usefulness of useDialogs.

Search keywords: payload useDialogs

@aress31 aress31 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 29, 2024
@Janpot
Copy link
Member

Janpot commented Oct 30, 2024

You should be able to pass anything as a payload. e.g. you can pass an object as we do internally for the system dialogs. The docs just use a string as an example. Perhaps we need to clarify this in the documentation?

@aress31
Copy link
Author

aress31 commented Oct 30, 2024

I can confirm that it's possible to pass any payload, but the PropType in the example was somewhat unclear. It might be beneficial to include a note in the documentation to clearly state that any payload type is acceptable for the component, and to update the PropType from string to any.

@prakhargupta1 prakhargupta1 added docs Improvements or additions to the documentation and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 4, 2024
@bharatkashyap bharatkashyap added the scope: toolpad-core Abbreviated to "core" label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation scope: toolpad-core Abbreviated to "core"
Projects
Status: Planned
Development

No branches or pull requests

4 participants