Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@reach/alert

Package Overview
Dependencies
Maintainers
4
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reach/alert - npm Package Compare versions

Comparing version 0.17.0 to 0.18.0-pre.0

CHANGELOG.md

38

package.json
{
"name": "@reach/alert",
"version": "0.17.0",
"version": "0.18.0-pre.0",
"description": "Screen-reader-friendly alert messages.",
"author": "React Training <hello@reacttraining.com>",
"license": "MIT",
"sideEffects": [
"*.css"
],
"repository": {

@@ -16,10 +13,12 @@ "type": "git",

"dependencies": {
"@reach/utils": "0.17.0",
"@reach/visually-hidden": "0.17.0",
"prop-types": "^15.7.2",
"tslib": "^2.3.0"
"@reach/utils": "0.18.0-pre.0",
"@reach/visually-hidden": "0.18.0-pre.0"
},
"devDependencies": {
"@reach-internal/dev": "0.0.0",
"@reach-internal/test": "0.0.0",
"@reach-internal/tsconfig": "0.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react-dom": "^17.0.2",
"tsup": "^6.1.3"
},

@@ -30,14 +29,17 @@ "peerDependencies": {

},
"main": "dist/reach-alert.cjs.js",
"module": "dist/reach-alert.esm.js",
"types": "dist/reach-alert.cjs.d.ts",
"main": "./dist/index.cjs.js",
"types": "./dist/index.d.ts",
"files": [
"CHANGELOG.md",
"LICENSE",
"README.md",
"dist"
],
"eslintIgnore": [
"node_modules",
"dist"
],
"gitHead": "d206aefac2bede58c06a54b18d48eee7537096e0"
}
"publishConfig": {
"access": "public"
},
"module": "./dist/index.mjs",
"scripts": {
"build": "tsup"
}
}

@@ -13,25 +13,25 @@ # @reach/alert

function Example(props) {
const [messages, setMessages] = React.useState([]);
return (
<div>
<button
onClick={() => {
setMessages((prevMessages) =>
prevMessages.concat([`Message #${prevMessages.length + 1}`])
);
setTimeout(() => {
setMessages((prevMessages) => prevMessages.slice(1));
}, 5000);
}}
>
Add a message
</button>
<div>
{messages.map((message, index) => (
<Alert key={index}>{message}</Alert>
))}
</div>
</div>
);
const [messages, setMessages] = React.useState([]);
return (
<div>
<button
onClick={() => {
setMessages((prevMessages) =>
prevMessages.concat([`Message #${prevMessages.length + 1}`])
);
setTimeout(() => {
setMessages((prevMessages) => prevMessages.slice(1));
}, 5000);
}}
>
Add a message
</button>
<div>
{messages.map((message, index) => (
<Alert key={index}>{message}</Alert>
))}
</div>
</div>
);
}
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc