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

297 refactor roomcontext zustand move #303

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

glowisn
Copy link
Collaborator

@glowisn glowisn commented May 3, 2024

Checklist

  • Code Review: 작성한 코드를 다시 한 번 꼼꼼이 확인했나요?
  • Testing: 앱이 잘 구동되는지 개발한 기능이 문제 없이 작동하는지 확인했나요?

Description

close #297

from #299

Changes Made

Extra Comments

Demo

@glowisn glowisn requested review from kiuuon and Lukaid-dev May 3, 2024 07:27
@glowisn glowisn self-assigned this May 3, 2024
Comment on lines +29 to +36
const { problems, setProblems, duration, setDuration } = useRoomStore(
useShallow((state) => ({
problems: state.problems,
setProblems: state.setProblems,
duration: state.duration,
setDuration: state.setDuration,
})),
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분 뿐만 아니라, useRoomStore()를 사용하는 부분은 다 이렇게 바꿔줘야 하는 것 같아요.


export default function RoomInfo() {
const { roomCode } = useRoom();
const { roomCode } = useRoomStore();
Copy link
Collaborator

@kiuuon kiuuon May 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 하나만 가져오는 경우에는
const roomCode = useRoomStore((state) => state.roomCode);
이렇게 쓰면 될 거 같습니다!

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.

Refactor : RoomContext -> Zustand 이사
2 participants