MCPcopy Create free account
hub / github.com/react-dates/react-dates / componentWillUpdate

Method componentWillUpdate

src/components/DayPicker.jsx:363–380  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

361 }
362
363 componentWillUpdate() {
364 const { transitionDuration } = this.props;
365
366 // Calculating the dimensions trigger a DOM repaint which
367 // breaks the CSS transition.
368 // The setTimeout will wait until the transition ends.
369 if (this.calendarInfo) {
370 this.setCalendarInfoWidthTimeout = setTimeout(() => {
371 const { calendarInfoWidth } = this.state;
372 const calendarInfoPanelWidth = calculateDimension(this.calendarInfo, 'width', true, true);
373 if (calendarInfoWidth !== calendarInfoPanelWidth) {
374 this.setState({
375 calendarInfoWidth: calendarInfoPanelWidth,
376 });
377 }
378 }, transitionDuration);
379 }
380 }
381
382 componentDidUpdate(prevProps, prevState) {
383 const {

Callers

nothing calls this directly

Calls 1

calculateDimensionFunction · 0.85

Tested by

no test coverage detected