sweetalert2 / sweetalert2-react-content

Official SweetAlert2 enhancer adding support for React elements as content
MIT License
703 stars 48 forks source link

Use custom button component #116

Closed cardimajs closed 4 years ago

cardimajs commented 4 years ago

Hi, is possible to use custom button component?

any demo?

Thank you.

zenflow commented 4 years ago

@cardimajs Of course. It says in the README confirmButtonText & cancelButtonText can be React elements. React elements can be React components. Refer to the example in the README and replace title: <p>Hello World</p>, with confirmButtonText: <MyCustomComponent />,.

limonte commented 4 years ago

It says in the README confirmButtonText & cancelButtonText can be React elements.

That's actually incorrect, I just checked with https://github.com/sweetalert2/sweetalert2-webpack-demo and React elements aren't accepted as the value for confirmButtonText:

image

image

limonte commented 4 years ago

:tada: This issue has been resolved in version 3.0.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: