Skip to content

How to access state of certain country? #526

Description

@devrudraa

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions