Skip to main content
Version: 3.5.2

NewsletterUpdateModal

The newsletter update modal is used to update the list of newsletters the user is subscribed to.

Loading...

Usage#

import React from "react";
import {
NewsletterUpdateModal,
PelcroModalController,
usePelcro,
} from "@pelcro/react-pelcro-js";
import "@pelcro/react-pelcro-js/dist/pelcro.css";
export const NewsletterUpdateExample = () => {
const { switchView } = usePelcro();
return (
<>
<button onClick={() => switchView("newsletter-update")}>
manage your newsletters subscriptions
</button>
<PelcroModalController>
<NewsletterUpdateModal />
</PelcroModalController>
</>
);
};

Reference#

Props#

onDisplay#

() โ‡’ void

Callback function called when the modal is first displayed.

onClose#

() โ‡’ void

Callback function called when the modal is closed.

onSuccess#

(userObject) โ‡’ void

Callback function called when the newsletters subscriptions are updated succesfully.

onFailure#

(errorObject) โ‡’ void

Callback function called when updating the newsletters subscriptions fails.