import * as React from "react"; import MailchimpSubscribe, { NameFormFields } from "react-mailchimp-subscribe"; const Example: React.StatelessComponent = () => ( <> (<> { hooks.status === "error" && hooks.message } { hooks.status === "sending" && Sending! } { hooks.status === "success" && It's been sent! {hooks.message} }
{ e.preventDefault(); hooks.subscribe({ EMAIL: "8675309@aol.com" }); }} /> )} url="spam.biz/subscribe" /> { /* once Typescript 2.9 is out, generics in components will be allowed, at that point uncomment these. */ } { /* https://github.com/Microsoft/TypeScript/pull/22415 */ } {/* render={(hooks) => ( { e.preventDefault(); hooks.subscribe({ myArbitraryData: "is here!" }); }} /> )} url="spam.biz/subscribe" /> render={(hooks) => ( { e.preventDefault(); hooks.subscribe({ FNAME: "大", LNAME: "哥", EMAIL: "da.ge@qq.com", }); }} /> )} url="spam.biz/subscribe" /> */} );