Unverified Commit ef1861b0 authored by Jenny Fung's avatar Jenny Fung Committed by GitHub
Browse files

fix: Allow tab to un/mount with transition (#4312)

Also, fix documentation errors:
- Tab component docs stated that the transition prop of value 'true' would use the 'Fade' transition. Rather, the 'Fade' transition is applied by default. Otherwise, the transition prop accepts 'false' or a react-transition-group 'Transition' component.
- Replace references to v2 with v4

Refs #3497
parent 02fbc161
...@@ -32,9 +32,9 @@ const propTypes = { ...@@ -32,9 +32,9 @@ const propTypes = {
}, },
/** /**
* Sets a default animation strategy for all children `<TabPane>`s. Use * Sets a default animation strategy for all children `<TabPane>`s.
* `false` to disable, `true` to enable the default `<Fade>` animation or * Defaults to `<Fade>` animation; else, use `false` to disable, or a
* a react-transition-group v2 `<Transition/>` component. * custom react-transition-group `<Transition/>` component.
* *
* @type {{Transition | false}} * @type {{Transition | false}}
* @default {Fade} * @default {Fade}
......
...@@ -27,9 +27,9 @@ const propTypes = { ...@@ -27,9 +27,9 @@ const propTypes = {
active: PropTypes.bool, active: PropTypes.bool,
/** /**
* Use animation when showing or hiding `<TabPane>`s. Use `false` to disable, * Use animation when showing or hiding `<TabPane>`s. Defaults to `<Fade>`
* `true` to enable the default `<Fade>` animation or * animation, else use `false` to disable or a react-transition-group
* a react-transition-group v2 `<Transition/>` component. * `<Transition/>` component.
*/ */
transition: PropTypes.oneOfType([PropTypes.bool, PropTypes.elementType]), transition: PropTypes.oneOfType([PropTypes.bool, PropTypes.elementType]),
...@@ -136,7 +136,7 @@ const TabPane = React.forwardRef((props, ref) => { ...@@ -136,7 +136,7 @@ const TabPane = React.forwardRef((props, ref) => {
const prefix = useBootstrapPrefix(bsPrefix, 'tab-pane'); const prefix = useBootstrapPrefix(bsPrefix, 'tab-pane');
if (!active && unmountOnExit) return null; if (!active && !Transition && unmountOnExit) return null;
let pane = ( let pane = (
<Component <Component
......
...@@ -29,9 +29,9 @@ const propTypes = { ...@@ -29,9 +29,9 @@ const propTypes = {
variant: PropTypes.string, variant: PropTypes.string,
/** /**
* Sets a default animation strategy for all children `<TabPane>`s. Use * Sets a default animation strategy for all children `<TabPane>`s.
* `false` to disable, `true` to enable the default `<Fade>` animation or * Defaults to `<Fade>` animation, else use `false` to disable or a
* a react-transition-group v2 `<Transition/>` component. * react-transition-group `<Transition/>` component.
* *
* @type {Transition | false} * @type {Transition | false}
* @default {Fade} * @default {Fade}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment