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


 843

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 (%)
11%



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 ...

  4.9K     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 ...

  843     127

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

Click to see more ...

  630     104

get ip address reactget ip address reactREACT

Click to see more ...

  403     81

time ago reacttime ago reactREACT

Click to see more ...

  298     73

detect mobile device reactdetect mobile device reactREACT

Click to see more ...

  269     58

get client country reactget client country reactREACT

Click to see more ...

  333     53

detect browser reactdetect browser reactREACT

Click to see more ...

  304     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 ...

  253     51