Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to access state of certain country? #526

Open
devrudraa opened this issue Apr 10, 2024 · 1 comment
Open

How to access state of certain country? #526

devrudraa opened this issue Apr 10, 2024 · 1 comment

Comments

@devrudraa
Copy link

I am trying to make an address form where users can select the country and based on the selection they can select the state and city but I didn't find any way to access the state or city of a particular country.

      <Select
        fullWidth
        value={selectedCountry}
        onChange={handleCountryChange}
        label="Country"
      >
            {countries.map((country) => {
              return (
                country && (
                  <MenuItem key={country.flag} value={country.flag}>
                    {country.name.common}
                  </MenuItem>
                )
              );
            })}
   </Select>

I want to get all the states based on the 'selectedCountry' value

Stack:

  • React-Vite
  • MUI
@mledoze
Copy link
Owner

mledoze commented Nov 20, 2024

I didn't find any way to access the state or city of a particular country

What do you mean? The dataset does not contains the cities of a country.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants