Skip to content

Commit

Permalink
refactor(Transition): mountOnEnter -> mountOnShow
Browse files Browse the repository at this point in the history
  • Loading branch information
levithomason committed Jul 26, 2017
1 parent b0d1c8f commit f2224e4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/modules/Transition/Transition.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface TransitionProps {
visible?: boolean;

/** Wait until the first "enter" transition to mount the component (add it to the DOM). */
mountOnEnter?: boolean;
mountOnShow?: boolean;

/**
* Callback on each transition that changes visibility to shown.
Expand Down
8 changes: 4 additions & 4 deletions src/modules/Transition/Transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class Transition extends Component {
visible: PropTypes.bool,

/** Wait until the first "enter" transition to mount the component (add it to the DOM). */
mountOnEnter: PropTypes.bool,
mountOnShow: PropTypes.bool,

/**
* Callback on each transition that changes visibility to shown.
Expand Down Expand Up @@ -79,7 +79,7 @@ export default class Transition extends Component {
animation: 'fade',
duration: 500,
visible: true,
mountOnEnter: true,
mountOnShow: true,
transitionAppear: false,
unmountOnHide: false,
}
Expand Down Expand Up @@ -218,7 +218,7 @@ export default class Transition extends Component {
computeInitialStatuses = () => {
const {
visible,
mountOnEnter,
mountOnShow,
transitionAppear,
unmountOnHide,
} = this.props
Expand All @@ -233,7 +233,7 @@ export default class Transition extends Component {
return { initial: Transition.ENTERED }
}

if (mountOnEnter || unmountOnHide) return { initial: Transition.UNMOUNTED }
if (mountOnShow || unmountOnHide) return { initial: Transition.UNMOUNTED }
return { initial: Transition.EXITED }
}

Expand Down
2 changes: 1 addition & 1 deletion test/specs/modules/Transition/Transition-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ describe('Transition', () => {
wrapperShallow(
<Transition
visible={false}
mountOnEnter={false}
mountOnShow={false}
unmountOnHide={false}
>
<p />
Expand Down

0 comments on commit f2224e4

Please sign in to comment.