Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jantoniogc/CursoReact-Clima/llms.txt

Use this file to discover all available pages before exploring further.

The country dropdown in Clima React App is populated with seven hard-coded <option> elements defined in src/components/Formulario.jsx. Only these countries are available by default; the user must select one before submitting a search. The select markup from the source (lines 55–63):
src/components/Formulario.jsx
<option value="">-- Selecciones un Pais --</option>
<option value="US">Estados Unidos</option>
<option value="MX">México</option>
<option value="AR">Argentina</option>
<option value="CO">Colombia</option>
<option value="CR">Costa Rica</option>
<option value="ES">España</option>
<option value="PE">Perú</option>

Supported countries

Country codeCountry name
USEstados Unidos (United States)
MXMéxico (Mexico)
ARArgentina
COColombia
CRCosta Rica
ESEspaña (Spain)
PEPerú (Peru)

How city and country are sent to the API

When the user submits the form, the app combines the city input and the selected country code into a single query string using the format {ciudad},{pais}. For example:
  • Madrid,ES
  • Buenos Aires,AR
  • Lima,PE
This value is passed directly to the OpenWeatherMap q parameter, so the spelling and format must match what the API expects.

Tips for accurate searches

  • Use the English or local spelling of the city name (e.g., Mexico City or Ciudad de México).
  • Avoid accented characters or special symbols if the API does not return results — try an unaccented variant instead.
  • Major cities and regional capitals are more reliably found than small towns or rural localities.

Adding more countries

You can extend the country list by adding more <option> elements to the <select> in src/components/Formulario.jsx. Use the ISO 3166-1 alpha-2 country code as the value attribute — this is the code the API expects in the q parameter.
For example, to add Chile:
src/components/Formulario.jsx
<option value="CL">Chile</option>
Insert it alongside the existing options inside the <select> block. No other changes are needed; the app will include the new country in the dropdown immediately.

Build docs developers (and LLMs) love