Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chap 8: Incorporating React Markdown #149

Open
khanhtran94 opened this issue May 8, 2022 · 0 comments
Open

Chap 8: Incorporating React Markdown #149

khanhtran94 opened this issue May 8, 2022 · 0 comments

Comments

@khanhtran94
Copy link

I think you not pass param login from UserRepositories to RepoMenu component
Readme not render because login undefined

import Fetch from "./Fetch";
import RepoMenu from "./RepoMenu";

export default function UserRepositories({
  login,
  selectedRepo,
  onSelect = f => f
}) {
  return (
    <Fetch
      uri={`https://api.github.com/users/${login}/repos`}
      renderSuccess={({ data }) => (
        <RepoMenu
          login={login}
          repositories={data}
          selectedRepo={selectedRepo}
          onSelect={onSelect}
        />
      )}
    />
  );
}

In RepositoryReadme, useEffect check !login, loadReadme will never run

 useEffect(() => {
    if (!repo || !login) {
      return;
    }
    loadReadme(login, repo).catch(setError);

  }, [repo]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant