REACT country dropdown react - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Just a Web Code Solution

country dropdown using react


 871

REACT


3

// you must install: npm install react-country-region-selector --save

import React from 'react';
import { CountryDropdown, RegionDropdown } from 'react-country-region-selector';

class App extends React.Component {
constructor (props) {
super(props);
this.state = { country: '' };
}

selectCountry (val) {
this.setState({ country: val });
}

render () {
const { country, region } = this.state;
return (
<div>
<CountryDropdown
value={country}
onChange={(val) => this.selectCountry(val)} />
</div>
);
}
}

export default App;


By     Created   
The power of the user (%)
12%



The most helpful REACT solutions

How to get client ip address using react ?How to get client ip address using react ?REACT

Click to see more ...

  5.8K     419

how to get the type of a device using react ?how to get the type of a device using react ?REACT

Click to see more ...

  1.5K     203

country dropdown using reactcountry dropdown using reactREACT

Click to see more ...

  871     127

How to get latitude and longitude using react/javascript ?How to get latitude and longitude using react/javascript ?REACT

Click to see more ...

  649     104

get client country reactget client country reactREACT

Click to see more ...

  458     82

get ip address reactget ip address reactREACT

Click to see more ...

  459     81

time ago reacttime ago reactREACT

Click to see more ...

  335     74

detect mobile device reactdetect mobile device reactREACT

Click to see more ...

  318     58

detect browser reactdetect browser reactREACT

Click to see more ...

  319     52

how to detect a mobile device not tablet using react ?how to detect a mobile device not tablet using react ?REACT

Click to see more ...

  267     51