Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
react-use-mailchimp-signup
Advanced tools
It provides an easy-to use React Hook to subscribe users to your MailChimp lists.
It provides an easy-to use React Hook to subscribe users to your MailChimp lists.
npm install react-use-mailchimp-signup --save
yarn add react-use-mailchimp-signup
Note version 2 fixes possible CORs issues and includes a breaking change to return error
as a Boolean.
You can now get more information about the error (and success) from the new message
property
import React, { useState } from 'react';
// import the hook
import { useMailChimp } from 'react-use-mailchimp-signup';
export const MyComponent = () => {
const { error, loading, status, subscribe, message } = useMailChimp({
action: `https://<YOUR-USER>.us18.list-manage.com/subscribe/post?u=XXXXXX&id=XXXXXX`,
});
const [inputs, setInputs] = useState({});
const handleInputChange = (event) => {
event.persist();
setInputs((inputs) => ({
...inputs,
[event.target.name]: event.target.value,
}));
};
const handleSubmit = (event) => {
if (event) {
event.preventDefault();
}
if (inputs) {
subscribe(inputs);
}
};
return (
<>
{error && <p>ERROR</p>}
{loading && <p>...Loading</p>}
{status && <p>{status}</p>}
{message && <p>{message}</p>}
<form onSubmit={handleSubmit}>
<label htmlFor="mchimpEmail">Email</label>
<input type="email" name="email" id="mchimpEmail" onChange={handleInputChange} />
<button type="submit">Sign me up!</button>
</form>
</>
);
};
subscribe
method error: boolean;
loading: boolean;
status: UseMailChimpStatus;
message: string | undefined;
subscribe: (passedFields: Partial<UseMailchimpFieldProps>) => Promise<void>;
FAQs
It provides an easy-to use React Hook to subscribe users to your MailChimp lists.
The npm package react-use-mailchimp-signup receives a total of 14 weekly downloads. As such, react-use-mailchimp-signup popularity was classified as not popular.
We found that react-use-mailchimp-signup demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.