U
U
ubbe_lodbroke2020-05-05 07:57:56
React
ubbe_lodbroke, 2020-05-05 07:57:56

Why is the useEffect hook being ignored?

Here is the code:

export default ({match}) => {
    const {user, loading, repos, getUser, getRepos} = useContext(GithubContext)
    const urlName = match.params.name

    useEffect(() => {
        getRepos(urlName)
    }, [])

    if(loading){
        return <p className={"text-center"}>Загрузка</p>
    }

     const {
        name, company, avatar_url,
        location, bio, blog,
        login, html_url, followers,
        following, public_repos,
        public_gists
      } = user

    return (
        <div></div>
    )
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question