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

react-country-dropdown

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-country-dropdown - npm Package Compare versions

Comparing version 2.2.0 to 3.0.0

2

dist/index.d.ts

@@ -20,3 +20,3 @@ type Currency = {

interface Props {
defaultCountry?: string;
defaultCountry: string;
onSelect: (country: ICountry) => void;

@@ -23,0 +23,0 @@ }

{
"name": "react-country-dropdown",
"version": "2.2.0",
"version": "3.0.0",
"description": "A simple react country selection dropdown component",

@@ -5,0 +5,0 @@ "keywords": [

@@ -27,4 +27,4 @@ # react-country-dropdown

<ReactCountryDropdown
defaultCountry="JP"
onSelect={(country) => console.log(country.name)}
defaultCountry="JP"
/>

@@ -35,4 +35,33 @@ );

## API
The `<ReactCountryDropdown/>` component accepts only two props.
### Props:
| Name | Type | Required | Default | Description |
| ---------------- | ------ | -------- | ------- | ------------------------------------------------------------------------- |
| `defaultCountry` | string | Yes | `null` | The default country code to be selected. |
| `onSelect` | func | Yes | `null` | Callback function when a country is selected. Returns the country object. |
#### Country Object:
```json
{
"name": "Japan",
"code": "JP",
"code2": "JPN",
"capital": "Tokyo",
"region": "Asia",
"citizen": "Japanese",
"flagUrl": "https://flagcdn.com/jp.svg",
"callingCodes": ["81"],
"timezones": ["UTC+09:00"],
"latlng": [36, 138],
"currencies": [{ "code": "JPY", "name": "Japanese yen", "symbol": "¥" }]
}
```
## License
[MIT](./LICENSE) &copy; 2024 [Rocktim Saikia](https://github.com/rocktimsaikia)

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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