Closed hhoangg closed 1 year ago
@hhoangg Not enough info here. This doesn't tell me what you're passing for html
.
Please fork this sandbox to provide a (minimal) reproduction: https://codesandbox.io/s/sweetalert2-react-content-sandbox-6mri0o I'll see if I can help.
As you can see in the sandbox though, the html
property seems to be working alright.
I'm sorry, my mistake sandbox here
The source on the Codesandbox is perfect work, but the source on my local is not working
Here is the error message
@hhoangg You're using the wrong type for options.
Import ReactSweetAlertOptions
from "sweetalert2-react-content" and use that instead.
The type error is a different issue though since types don't affect runtime behavior.
As you said, the sandbox doesn't reproduce your original issue. I can't really help with that issue unless we have a reproduction. I suggest work on reproducing the issue, by adding to the sandbox step by step, until one step brings out the issue, and then you will probably know what your issue is and you probably won't need any help
Import
ReactSweetAlertOptions
from "sweetalert2-react-content" and use that instead.
This change solved my problem.
But I wonder why on Codesandbox I don't use that type
but don't get errors like below my source.
But anyway this answer solved my problem, thank you for taking some time to help me
I created a function like above, but when I pass the property
html
in it doesn't work properly, instead it shows as[object Object]
can you tell me where i am wrong? please.