Skip to content

Sweet Alerts!

cjnunez edited this page Nov 7, 2019 · 1 revision

Sweet Alerts Integration

General Purpose

Sweet Alerts is a React friendly library to display window alerts and enhance the responsiveness of the overall site. I highly recommend looking over their documentation before each sweet alert is highly customize-able. The initial integration with Electra only scratches the surface of what it can do.

Link

Sweet alert Documentation

Installation

For React (Electra's purposes)

npm install --save sweetalert2 sweetalert2-react-content

Regular install

npm install sweetalert2

Implementation

Import Statement

Import these two statements in the beginning of the file you want to use sweet alerts in.

Creating a function

You don't have to create a event function to use these however, I found it makes it easier to call it when using it in other code.

In line code example

Clone this wiki locally