Reputation: 339
I am using react-modal to create modals, and trying to slide the modal from bottom of page. For that i am trying react-motion TransitionMotion Component. My code is:
{ this.state.openNumberPopup &&
<TransitionMotion
styles={[{key: 'key',style: this.getStyles()}] }
>
{
(interpolated) =>
<div> {
interpolated.map(({ key, style, data }) =>
<NumberPopup
key={${key}-transition}
style={{opacity: style.opacity,transform: scale(${style.scale})}}
openNumberPopup={this.state.openNumberPopup}
toggleNumberPopup={this.toggleNumberPopup}
handleChange={this.handleChange}
updateNumber={this.updateNumber}
disableSubmit={this.state.disableSubmit}
/>
)
}
</div>
}
</TransitionMotion>
}
where getStyles is:
getStyles = () => ({ opacity: spring(1), scale: spring(1) });
but this is not working because modal component.
Upvotes: 1
Views: 71