-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Provide RoomViewStore from the RoomContext #30980
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
base: develop
Are you sure you want to change the base?
Conversation
|
||
const llMembers = context.client.hasLazyLoadMembersEnabled(); | ||
this.state = { | ||
roomViewStore: props.roomViewStore, |
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.
Why putting the store in the state? You can use this.props.roomViewStore
in the component
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.
Because the state is used as the RoomContext, example here.
I have updated the PR description to provide better context.
…eyd/context-provided-room-view-store
What's in this PR?
It adds the RoomViewStore to the constructor of RoomView and add's it to the RoomView state which in turn is used as the RoomContext. This means the RoomViewStore can be accessed from the RoomContext within the component hierarchy of the RoomView.. This is needed if are to support multiple RoomViews/RoomViewStores(instead of the singleton RoomViewStore).
A second PR will follow that updates the usages of the RoomViewStore within the RoomView sub-components to use the one from the RoomContext.