---
title: "Discussion on \"How to pre-fill user country and state fields in Reactjs forms\" | Hashnode"
description: "Discussion on \"How to pre-fill user country and state fields in Reactjs forms\". Learn how to detect the user's country and state based on his or her IP address, and pre-fill the order forms in React"
url: "https://hashnode.com/posts/how-to-pre-fill-user-country-and-state-fields-in-reactjs-forms/6331aa534dd8b2344a7694ab"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to pre-fill user country and state fields in Reactjs forms](https://chaoming.hashnode.dev/how-to-pre-fill-user-country-and-state-fields-in-reactjs-forms?utm_source=hashnode&utm_medium=feed)

Learn how to detect the user's country and state based on his or her IP address, and pre-fill the order forms in React

Sep 26, 2022 · 3 min read · chaoming.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#location-api](https://hashnode.com/tag/location-api)
-   [#npm](https://hashnode.com/tag/npm)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[Chaoming Li](https://hashnode.com/@chaoming)

@chaoming · Sydney, Australia

  
[View profile](https://hashnode.com/@chaoming)

Tech entrepreneur

## Responses 1

Markdown supported · ⌘↵ to post

[Sarah](https://hashnode.com/@sarahcodes)

[Sep 26, 2022](https://hashnode.com/posts/how-to-pre-fill-user-country-and-state-fields-in-reactjs-forms/6331aa534dd8b2344a7694ab/comment/6331ba864dd8b2344a769653)

Very cool! Thanks for sharing. Might have to use this in my next React project!
