An optional className that should ge merged with the CSS transition class name based on the current transition stage.
The transition class names to apply. Unlike in react-transition-group
, if
this is a string
instead of an object, the different states will be
--{state}
instead of -{state}
.
Example:
const options = {
classNames: "scale"
}
// creates
const classNames = {
enter: "scale--enter",
enterActive: "scale--enter-active",
exit: "scale--exit",
exitActive: "scale--exit-active",
}
const options = {
classNames: "scale"
appear: true,
}
// creates
const classNames = {
appear: "scale--enter",
appearActive: "scale--enter-active",
enter: "scale--enter",
enterActive: "scale--enter-active",
exit: "scale--exit",
exitActive: "scale--exit-active",
}
Boolean if the transition should allow for an enter animation once the
transitionIn
booleanis set to true
.
Boolean if the transition should allow for an exit animation once the
transitionIn
booleanis set to false
.
An optional enter handler that can be used to determine additional
transition styles if you need access to the DOM node to calculate those
styles. This will also be fired for appear
transitions.
This will be fired right after the transitionIn
is set to true
.
An optional entered handler that can be used to determine additional
transition styles if you need access to the DOM node to calculate those
styles. This will also be fired for appear
transitions.
This will be fired once the transition has finished.
An optional entering handler that can be used to determine additional
transition styles if you need access to the DOM node to calculate those
styles. This will also be fired for appear
transitions.
This will be fired almost immediately after the onEnter
callback.
However, if the repaint
option was enabled, it will ensure the DOM as
been repainted before firing to help with CSS transitions.
An optional exit handler that can be used to determine additional transition styles if you need access to the DOM node to calculate those styles.
This will be fired right after the transitionIn
is set to false
.
An optional entered handler that can be used to determine additional
transition styles if you need access to the DOM node to calculate those
styles. This will also be fired for appear
transitions.
This will be fired once the transition has finished.
Note: If the temporary
option was enabled, the rendered
result will be
false
and the node actually won't exist in the DOM anymore.
An optional exit handler that can be used to determine additional transition styles if you need access to the DOM node to calculate those styles.
This will be fired almost immdiately after the onExit
callback. However,
if the repaint
option was enabled, it will ensure the DOM as been
repainted before firing to help with CSS transitions.
An optional ref that will get merged with the required ref for the transition to work.
Boolean if the component should mount and unmount based on the current
transitionIn
stage with a default value of false
. When this is
false
, the first result (rendered
) in the return value array will
always be true
.
When this is set to true
, the first result (rendered
) in the return
value array will be true
only while the transitionIn
option is true
or the transition is still happening.
Note: Changing this option while the hook/component is mounted will not
do anything. If you want to dynamically change the component's temporary
state, you will need to also change the key
to get the component to
re-mount.
The transition timeout to use for each stage. Just like in
react-transition-group
, this can either be a number
which will a static
duration to use for each stage. Otherwise, this can be an object of
timeouts for the appear
, enter
, and exit
stages which default to 0
if omitted.
Note: If any of the timeout values are set to 0
, the transition will be
considered disabled and skip the ENTERING
/EXITING
stages.
Note: If the appear
stage is omitted in the timeout object but the
appear
option was enabled for the transition, it will instead default to
the enter
duration.
Changing this boolean will trigger a transition between the six stagees:
ENTER
ENTERING
ENTERED
EXIT
EXITING
EXITED
Changing from false
to true
, the stagees will change in this order:
EXITED -> ENTER -> ENTERING -> ENTERED
Changing from true
to false
, the stagees will change in this order:
ENTERED -> EXIT -> EXITING -> EXITED
Generated using TypeDoc
Boolean if the transition should also be triggered immediately once the component mounts. This is generally not recommended for server side rendering/initial page load so it is set to
false
by default.