Skip to content

Conversation

@git-babel
Copy link
Contributor

@git-babel git-babel commented Feb 26, 2025

Ticket

SBISSUE-18637

Changelog

  • Create store instance with the props as default value.
    • Before stabilization refactoring, each provider set their context value synchronously if possible. But during refactoring, we put the all set up process in async effect hook, including initialization. This change caused various unexpected bugs.

@netlify
Copy link

netlify bot commented Feb 26, 2025

Deploy Preview for sendbird-uikit-react ready!

Name Link
🔨 Latest commit a161730
🔍 Latest deploy log https://app.netlify.com/sites/sendbird-uikit-react/deploys/67bfdf5d06aad700085d3097
😎 Deploy Preview https://deploy-preview-1316--sendbird-uikit-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

* Create store for Sendbird context
*/
export const createSendbirdContextStore = () => createStore(initialState);
export const createSendbirdContextStore = (props?: any) => createStore({
Copy link
Collaborator

@chrisallo chrisallo Feb 26, 2025

Choose a reason for hiding this comment

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

여기 props 타입을 PartialDeep<SendbirdState>로 하는건 어떤가요?

Copy link
Contributor Author

@git-babel git-babel Feb 27, 2025

Choose a reason for hiding this comment

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

비슷한 부분들 일괄 수정했습니다.
SendbirdContextStore를 제외한 Store들은 값들을 flat하게 가지고 있기 때문에 굳이 PartialDeep을 사용할 필요가 없어 Partial로 대체했습니다.
SendbirdContextStore의 경우 PartialDeep을 사용하게 되면 scrollRef와 같이 object를 value로 가질 경우 이 모두 optional로 취급되어 타입 에러가 발생합니다. 따라서 현재 SendbirdState의 구조에 맞춰 TwoDepthPartial을 추가했습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

다만 코드 미관상으로 그렇게 좋지는 않은 것 같습니다. 수정할 부분 있으면 말씀주세요.

Copy link
Collaborator

Choose a reason for hiding this comment

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

빠르게 도입할 수 있는 대안이 없는것같아서 일단 고 하시죠ㅎㅎ

Copy link
Collaborator

@chrisallo chrisallo left a comment

Choose a reason for hiding this comment

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

lgtm!

@git-babel git-babel merged commit c271c12 into main Feb 27, 2025
10 checks passed
@bang9 bang9 deleted the fix/sbissue-18637 branch November 7, 2025 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants