# @types/react-mailchimp-subscribe

> TypeScript definitions for react-mailchimp-subscribe

Latest version **2.1.4** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/react-mailchimp-subscribe
pnpm add @types/react-mailchimp-subscribe
yarn add @types/react-mailchimp-subscribe
bun add @types/react-mailchimp-subscribe
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.1.4 |
| Published | 2023-11-07 |
| First published | 2018-04-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51442 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/react-mailchimp-subscribe
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-mailchimp-subscribe
- npm.io page: https://npm.io/package/@types/react-mailchimp-subscribe

## Dependencies (1)

- [@types/react](https://npm.io/package/@types/react.md) *

## Recent versions

- 2.1.4 (latest) — 2023-11-07
- 2.1.1 (ts3.6) — 2021-07-08
- 2.1.0 (ts3.0) — 2020-08-12
- 2.0.2 (ts2.9) — 2018-11-05
- 2.0.1 (ts2.8) — 2018-08-06
- 2.0.0 (ts2.6) — 2018-04-09
- 2.1.3 — 2023-10-18
- 2.1.2 — 2023-09-27

## README

# Installation
> `npm install --save @types/react-mailchimp-subscribe`

# Summary
This package contains type definitions for react-mailchimp-subscribe (https://revolunet.github.io/react-mailchimp-subscribe/).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-mailchimp-subscribe.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-mailchimp-subscribe/index.d.ts)
````ts
import { Component, ReactNode } from "react";

// A few common set of form fields, based on defaults in Mailchimp's website
export interface EmailFormFields {
    EMAIL: string;
}

export interface NameFormFields extends EmailFormFields {
    FNAME: string;
    LNAME: string;
}

export interface ClassicFormFields extends NameFormFields {
    "BIRTHDAY[month]": number;
    "BIRTHDAY[day]": number;
}

// library default form just sends EMAIL
export type DefaultFormFields = EmailFormFields;

export interface ErrorResponseArgs {
    status: "error";
    message: string | Error;
}

export interface SuccessResponseArgs {
    status: "success";
    message: string;
}

export type ResponseArgs = ErrorResponseArgs | SuccessResponseArgs;

export interface PendingArgs {
    status: "sending" | null;
    message: null;
}

export interface SubscribeArg<FormFields> {
    subscribe: (data: FormFields) => void;
}

export type FormHooks<FormFields> = SubscribeArg<FormFields> & (ErrorResponseArgs | SuccessResponseArgs | PendingArgs);

export interface Props<FormFields> {
    render?: ((hooks: FormHooks<FormFields>) => ReactNode) | undefined;
    url: string;
}

export default class MailchimpSubscribe<FormFields = DefaultFormFields> extends Component<Props<FormFields>> {}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: [@types/react](https://npmjs.com/package/@types/react)

# Credits
These definitions were written by [Omar Diab](https://github.com/osdiab).

---
_Source: https://npm.io/package/@types/react-mailchimp-subscribe · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
