Material-ui: [Grow] When used withe Dialog receives unexpected enter/leaveTransitionDuration props

Created on 26 Sep 2017  路  3Comments  路  Source: mui-org/material-ui

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

Expected Behavior

Grow transition honors the enter/leave durations propagated from the Dialog component.

Current Behavior

Dialog accepts enter and leaveTransitionDuration props but the Grow transition only accepts the transitionDuration prop. This effectively ignores the props given to the Dialog.

Steps to Reproduce (for bugs)

https://codesandbox.io/s/l476j33mjq

  1. Click 'Show dialog'
  2. Observe that react warning in console

Context

One can use props directly on a Grow transition (and in fact the defaults are great in my case) so not a super important bug but it might rear it's head in other places.

Your Environment

| Tech | Version |
|--------------|---------|
| Material-UI | 1.0.0-beta.12 |
| React | 16 rc3 |
| browser | chrome |

breaking change bug 馃悰 Transition

All 3 comments

I think that the best path going forward is to have all our transition component following this API:

type Props = {
  enterTransitionDuration: number,
  leaveTransitionDuration: number,
};

Hence, removing the transitionDuration property. What do you think?

Yeah makes sense to me for the transitions to all follow the same public API. Should make using them easier in general.

Actually, react-transition-group API looks perfect for our use case: https://reactcommunity.org/react-transition-group/#Transition-prop-timeout

I'm on it.

Was this page helpful?
0 / 5 - 0 ratings