Devextreme-reactive: Override WeekView to re-render when its props change

Created on 15 May 2019  路  6Comments  路  Source: DevExpress/devextreme-reactive

  • [x] I have searched this repository's issues and believe that this is not a duplicate.

I'm using ...

  • [ ] React Grid
  • [ ] React Chart
  • [x] React Scheduler

Description


Hi, it seems like the current implementation of WeekView in React Scheduler has the following constraint:

  • props such as startDayHour, endDayHour and excludedDays etc. only gets rendered once, and doesn't re-render after the first initialisation

Am I correct? If so, how do I override such behaviour, as I would like to allow users to dynamically update startDayHour and endDayHour that fits their needs (e.g some people might not have plans from 12am-6am, but some might).

My current implementation is as follows:

  • a parent component that holds the states that can be manipulated by users (e.g. startDayHour);
  • a child component that includes Week View, such as:
    <WeekView startDayHour={this.props.startDayHour} />
    , where the props are managed by parent component
  • when the user update the startDayHour via an input field, parent's state is updated
  • WeekView startDayHour is updated accordingly, but doesn't get re-rendered despite the value is changed

This is probably due to the current implementation of WeekView as a Pure Component, how can I get around this?

Please correct me if I'm wrong. Thanks in advance!

Environment

  • devextreme-reactive: xxx
  • react: xxx
  • browser: xxx
  • bootstrap: none
  • react-bootstrap: none
  • material-ui: none
Scheduler bug

All 6 comments

@AngelineLim,

I reproduced this behavior. We will try to fix this.

Hey @MaximKudriavtsev, lovely! Thank you!

Any workarounds for my use case while we wait for the bug to be fixed?

@AngelineLim

Unfortunately, we don't have any workaround. We are working on the fix and will update this topic if we have any results.

Workaround: Use a key for the parameter of interest - either or both - startDayHour, endDayHour - but put it on the parent Scheduler <Scheduler key={startDayHour+endDayHour}>

@AngelineLim, @Log-of-e,

We have released the 1.11.1 version of DevExtreme Reactive Scheduler with this fix.

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests.

Was this page helpful?
0 / 5 - 0 ratings