1

I'm using <Transition> as explained in main documentation of React Transition Group.

import React from 'react';
import PropTypes from 'prop-types';
import Transition from 'react-transition-group/Transition';

const defaultStyle = {
 transition: `opacity 300ms ease-in-out`,
 opacity: 0,
};

const transitionStyles = {
 entering: { opacity: 1 },
 entered: { opacity: 1 },
};

const Fade = ({
 in: inProp,
 children,
}) => (
 <Transition in={inProp} timeout={300}>
  {state => (
   <div
    style={{
      ...defaultStyle,
      ...transitionStyles[state],
    }}
  >
    {children}
  </div>
)}
</Transition>
);

Fade.propTypes = {
 in: PropTypes.bool.isRequired,
 children: PropTypes.node.isRequired,
};

export default Fade;

It works, but not so well with Material UI, especially with Buttons, everywhere on my app: when I click on them, appears a white div behind them:

<div in="false" style="position: absolute; top: -88.218px; left: -97.218px; height: 220.436px; width: 220.436px; border-radius: 50%; background-color: rgb(255, 255, 255);"></div>

and this weird error in console:

Warning: Unknown props `onExited`, `appear`, `enter`, `exit` on <div> tag. Remove these props from the element.

Those props are about Transition, but I can't understand the problem.

I'm using React 15.6.1, Material ui 0.18.7 and React Transition Group 2.2.0

timhecker
  • 93
  • 2
  • 8

1 Answers1

0

I encountered this bug today, and I logged an issue + repro case on their github.

https://github.com/callemall/material-ui/issues/8046

(repro: https://codesandbox.io/s/q9o5q0l5nw)

I have tested in v1.0.0-beta.8 and it looks like it's working fine (https://codesandbox.io/s/r5nplz89nn).

The project's stance is essentially "material-ui v0.x is legacy code". So your options are either; disable ripples across your app, fix it for them via a PR, or move to the unfinished v1 beta branch.

Brad Zacher
  • 2,915
  • 18
  • 31
  • Thanks. For the moment, I solved using CSSTransitionGroup version 1.2.0. In my next projects, surely, I'm using Material UI v1. – timhecker Sep 07 '17 at 09:38