Skip to content

Instantly share code, notes, and snippets.

View MoTechStore's full-sized avatar
🏠
Working from home

IT Geek MoTechStore

🏠
Working from home
  • git push & git pull
  • Somewhere
View GitHub Profile
@MoTechStore
MoTechStore / form.js
Created October 22, 2022 09:38
How To Create Select Dropdown in React JS With Fetched Data From API
import React, {useState,useEffect} from 'react'
function Form() {
const [companyName, setCompanyName] = useState("")
const [companyOwner, setCompanyOwner] = useState("")
const [ownerAddress, setOwnerAddress] = useState("")
const [companyList, setCompanyList] = useState([{'name':'','id':''}])
useEffect(() =>{
const fetchData = async ()=>{