-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
BigCalendar is not re-rendering on resource list update #1040
Comments
I'm faced with the same problem... |
Not a great solution but what I have done is just make they key of the calendar some value that only changes whenever the resource changes. This causes a full tear-down and remounting of the whole component so not the best but it does "work" |
Thanks aaronnuu! It helped me! |
Guys, we need to fix this thing: It saves the computed value on TimeGrid initialization but it doesn't update it. As I understand, it's not enough to add same line in @jquense any ideas how to fix it in better way? What was the purpose of storing computed value as |
The computed resources needs to be in state, since changing the resources array will almost always lead to something new being rendered. The fix should be as simple as storing resources in state and updating that state in |
@dmitrykrylov setting state from props is only an anti-pattern if the state isn't fully controlled by those props. That being said, your solution is still probably the more correct one. |
Do you want to request a feature or report a bug?
Bug
What's the current behavior?
I'm able to render the calendar for first time and after that if there is any resource state update, it doesn't re-render the page to show new list of resources.
I'm not sure whether it's expected behavior or there is some error in my code.
My Code:
render() {
let eventList = [];
if (this.props.eventList && this.props.eventList instanceof Array) {
eventList = this.props.eventList
}
}
What's the expected behavior?
It should update the resource list to display the latest list of resources.
The text was updated successfully, but these errors were encountered: