Skip to content

Changing texts

For changing texts, you can use the following properties:

  • buttonNoText
  • buttonYesText
  • toastText
import { useState } from 'react'
import { ConfirmToast } from 'react-confirm-toast'
export function Page() {
const [show, setShow] = useState(false)
function myFunction() {
alert('Done!')
}
return (
<section>
<h1>Page</h1>
<button
onClick={() => {
setShow(true)
}}
>
Click to open ConfirmToast
</button>
<ConfirmToast
buttonNoText='No'
buttonYesText='Yes'
toastText='Are you sure?'
customFunction={myFunction}
setShowConfirmToast={setShow}
showConfirmToast={show}
/>
</section>
)
}