Question: I'm trying to update state immediately after data comes in from the API. The data is coming in, I can see it using the console.log right below my API request. All of the data is right but for some reason, setState never sets in my hook. It just returns and empty array even after the console displays data.

```
const [experienceData, setExperienceData] = useState([]);

const { match = {} } = props;

    useEffect(() => {
        async function fetchData() {
            if (Object.keys(match.params).length > 0) {
                const response = await ApiService.getExperiences(match.params.experieneId);
                console.log(response)
                setExperienceData(response)
            }
        }
        fetchData();
    }, []);

```

I must be doing something wrong but I can't figure out what that is. Hoping someone on here has run into the same issue.

UPDATE: I just changed everything over the a class and duplicated the exact code on another file and ran into the exact same issue. The console updates with the data, but the setState on the line immediately after the data does not setState.

```
async componentDidMount() {
        if (Object.keys(this.props.match.params).length > 0) {
            const response = await ApiService.getExperiences(this.props.match.params.experieneId);
            console.log(response[0])
            this.setState({ experienceData: response[0], occurrenceData: response[0].occurrences });
        }
    }

```

Answer: 
You have to useSetState in a proper way, the issue is in the setExperienceData

```
const [experienceData, setExperienceData] = useState({response:""});

const { match = {} } = props;

useEffect(() => {
    async function fetchData() {
        if (Object.keys(props.match.params).length > 0) {
            const response = await ApiService.getExperiences(match.params.experieneId);
            console.log(response)
            setExperienceData(experienceData => ({ ...experienceData, response: response }));
        }
    }
    fetchData();
}, []);
return(<div>check {experienceData.response}</div>)

```
Could you please try passing `[match.params]` as the second argument to your useEffect.