Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
react-select-cities
Advanced tools
This package built on [`react-select`](https://www.npmjs.com/package/react-select) to select cities, countries, regions, ..etc.
This package built on react-select
to select cities, countries, regions, ..etc.
You can install it using npm
npm install react-select-cities
then use it in your app like this:
import React, { useState } from 'react';
import ReactSelect from 'react-select-cities';
function App() {
const [inputValue, setValue] = useState("");
return (
<div className="App">
<ReactSelect
maxCountriesNumber={5}
onInputChange={value => {
const inputValue = value.replace(/\W/g, "");
setValue(inputValue);
return inputValue;
}}
inputValue={inputValue}
onChange={(a, b) => {
console.log("from Parent: ", a, b);
}}
/>
</div>
);
}
export default App;
Prop | Type | Usage | Note |
---|---|---|---|
maxCountriesNumber | Number | The maximum number of countries you can select. | you can select any number of cities/regions/zipcode under those countries, but you can't add another country. |
onInputChange | Function | fires when you change the input value. | (inputValue) => { return inputValue;} |
inputValue | String | The input value you entered | you can manage it using state |
onChange | Function | Fires when the value of cities changed | (currentSelectedCities, lastAction) => {} |
All the previous props are required and you have to set them.
FAQs
This package built on [`react-select`](https://www.npmjs.com/package/react-select) to select cities, countries, regions, ..etc.
The npm package react-select-cities receives a total of 2 weekly downloads. As such, react-select-cities popularity was classified as not popular.
We found that react-select-cities 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.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.