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

useContextを介してFishesを取得&管理する #23

Merged
merged 4 commits into from
Jul 17, 2022

Conversation

yukinissie
Copy link
Collaborator

@yukinissie yukinissie commented Jul 17, 2022

魚を全件取得するAPIを一度だけ実行するだけで済むようにReact標準フックのuseContextを使っています。アプリ内のプログラムはuseStateに保持された値を使い回すだけで済むはずです。(初めてなので自信ない。。)アプリ内の任意の場所でconst { data, isLoading, isError } = useContext(FishesContext)するとdataから全お魚のデータを取れます。

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-smoke-0c29e3100-23.eastasia.1.azurestaticapps.net

@yukinissie yukinissie self-assigned this Jul 17, 2022
@yukinissie yukinissie force-pushed the feature/useContext branch from f61ae27 to b5c4189 Compare July 17, 2022 10:19
@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-smoke-0c29e3100-23.eastasia.1.azurestaticapps.net

1 similar comment
@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-smoke-0c29e3100-23.eastasia.1.azurestaticapps.net

@takatoshiinaoka takatoshiinaoka merged commit 3e765d3 into main Jul 17, 2022
@takatoshiinaoka takatoshiinaoka deleted the feature/useContext branch July 17, 2022 10:53
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

Successfully merging this pull request may close these issues.

2 participants