chenglou / react-motion

A spring that solves your animation problems.
MIT License
21.71k stars 1.15k forks source link

not able to animate custom component #522

Open garima33 opened 6 years ago

garima33 commented 6 years ago

import React, { Component } from "react"; import styled from "react-emotion"; import { TransitionMotion, spring } from "react-motion"; import { TopNav } from "./TopNav"; import Calendar from "./Calender";

export default class CalendarContainer extends Component { willLeave = () => { return { scale: 0 }; }; render() { const Container = styled("div") padding: 1em; margin: 2em; ; return ( <TransitionMotion willLeave={this.willLeave} defaultStyles={[ { key: "key", style: { scale: 0 } } ]} styles={[ { key: "key", style: { scale: spring(1) } } ]}

{interpolatedStyles => (

{" "} {interpolatedStyles.map(config => { return ( ); })}

)} ); } }

if i change Calender to div it works. Can someone explain y ?