trungdq88 / react-router-page-transition

Highly customizable page transition component for your React Router
https://trungdq88.github.io/react-router-page-transition
MIT License
543 stars 53 forks source link

Doesn't seem to work with React.cloneElement() #21

Closed paulincai closed 3 years ago

paulincai commented 7 years ago

It is a common and simple practice to use top component data container and pass props to a couple of mobile pages via React.cloneElement(). Example:

{this.props.children ? React.cloneElement(this.props.children, {...this.props}) : }

In this case, before even adding transition classes and ids to top DIVs in the children, things on the screen are looking scrambled, like content is getting doubled on the vertical.

trungdq88 commented 7 years ago

Can you provide a code snippet to reproduce the problem?

nontachaiwebdev commented 7 years ago

I think.Now i got this problem too maybe it happen because React.cloneElement().Now am try to fixed and wait for solution from @trungdq88

thankyou

trungdq88 commented 6 years ago

Close due to inactive.

theasia-Ashish commented 6 years ago
screen shot 2561-02-23 at 17 37 40

Its not working with React.cloneElement and also throwing some weird error for graphql wrapped component.

trungdq88 commented 6 years ago

@theasia-Ashish if you are wrapping the component with graphql, please do one of the following to get <PageTransition> to work:

theasia-Ashish commented 6 years ago

@trungdq88 I tried both nothing is working if i apply React.cloneElement on this.props.children. its double the content of the page and add/remove classes continuously.

screen shot 2561-02-26 at 13 55 19 screen shot 2561-02-26 at 13 55 25
trungdq88 commented 6 years ago

@theasia-Ashish Have you find a way to fix it yet?