I am new to ReactJS and working with Hooks. I want to set state for object. Here is my code:
const StartPage = (props)=> {
const [user,setUser] = useState
I'm not exactly sure what you mean by "not working" but it looks like you are deconstructing info but not data. My suspicion is that it is setting state but not the way you want. If data is an object with email as a property you most likely will want to deconstruct that too like this:
setInfo({...info, ...data})
You can use useEffect to console.log state changes if you want with something like this:
import React, { useState, useEffect } from 'react'
const StartPage = props => {
const [info,setInfo] = useState({ email:'' })
useEffect(() => {
console.log(info)
}, [info])