-
Notifications
You must be signed in to change notification settings - Fork 0
メモアプリにログインボタンを追加 #2
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
Conversation
useLogin、LoginProviderの2つをexportしているファイルを |
src/hooks/useLogin.js
Outdated
return storedIsLoggedIn || false; | ||
}); | ||
const login = () => { | ||
setIsLoggedIn((prev) => !prev); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(not important) この挙動なら関数名は toggleLogin
などのほうが妥当かと思いました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toggleLogin
に変更しました。
src/hooks/useLogin.js
Outdated
login: () => {}, | ||
}); | ||
|
||
export const LoginProvider = ({ children }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
永続化しているのはいいですね!
このコンポーネントの全体の機能は LoginProvider なので、ファイル名も LoginProvider.js の方が妥当かもと思いました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ファイル名をLoginProvider.js
に変更しました。
やったこと
メモアプリにログインボタンに追加
できるようになること
動作確認
未ログイン状態
ログイン状態
prettier、eslint
その他