npm install react-countryname-flag --save-dev
or
yarn add -D react-countryname-flag
import { CountryFlag } from 'react-countryname-flag'
<CountryFlag countryName={'Afghanistan'} style={{ fontSize: '20px' }} />
🇦🇫
import { CountryFlag } from 'react-countryname-flag'
<CountryFlag countryCode={'AG'} />
🇦🇬
import { CountryCode } from 'react-countryname-flag'
<CountryCode countryName={'Afghanistan'} />
// AF
import { CountryName } from 'react-countryname-flag'
<CountryName countryCode={'AG'} />
// Antigua and Barbuda