Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Make timeout optional property #18

Closed
wants to merge 4 commits into from

Conversation

teleginzhenya
Copy link

Resolves #17 and vercel/next.js#6086

Copy link
Member

@nwalters512 nwalters512 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't particularly like this because timeout is in fact a required property for the underlying Transition. I still want people to get prop type failures in development mode, even if they won't be validated in a production environment. I don't know that there's a particularly elegant solution to this; maybe something like

timeout: (props, ...args) => {
  let pt = timeoutsShape
  if (pt) {
    pt = pt.isRequired
    return pt(props, ...args)
  }
}

@@ -268,9 +268,10 @@ PageTransition.propTypes = {

PageTransition.defaultProps = {
loadingComponent: null,
loadingCallbackName: 'pageTransitionReadyToEnter',
loadingCallbackName: 'pagesTransitionReadyToEnter',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this prop name changed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this is typo, will fix it soon

@euharrison
Copy link

src/PageTransition.js Outdated Show resolved Hide resolved
Co-Authored-By: teleginzhenya <[email protected]>
@nwalters512
Copy link
Member

Closing in favor of #21 - thanks for your work on this though!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants