Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/oktaysenkan/use-countries

Custom react hook to list countries and languages.
https://github.com/oktaysenkan/use-countries

countries hook javascript languages react

Last synced: about 1 month ago
JSON representation

Custom react hook to list countries and languages.

Awesome Lists containing this project

README

        

# useCountries

You can list `countries` and `languages`

## Installing

```
npm i use-countries --save
```

```
yarn add use-countries
```

## Usage

```jsx
import useCountries from "use-countries";
const {
countries,
languages,
country,
setCountry,
language,
setLanguage
} = useCountries();
```

```js

{countries.map(item => (
{item.name}
))}

```

### Country

```json
{
"code": "AD",
"name": "Andorra",
"native": "Andorra",
"phone": "376",
"continent": "EU",
"capital": "Andorra la Vella",
"currency": "EUR",
"languages": ["ca"],
"emoji": "🇦🇩",
"emojiU": "U+1F1E6 U+1F1E9"
}
```

### Language

```json
{ "code": "AA", "name": "Afar", "native": "Afar" }
```