Skip to content

how to use react-motion library with modals #572

@rajatgalav

Description

@rajatgalav

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions