// ZonedDateTime contains timezone information at the end
// For example, 2011-12-03T10:15:30+01:00[Europe/Paris]
public static ZonedDateTime getDate(String dateString) {
return ZonedDateTime.parse(dateString).withZoneSameInstant(ZoneId.of("UTC"));
}
public static String formatDate(String format, String dateString) {
return DateTimeFormatter.ofPattern(format).format(getDate(dateString));
}
我想在列表出现时播放(
<TransitionGroup>
{conversationArray.map(
(item, index) => (
<CSSTransition
classNames={{
appear: 'ConversationItem-right-enter',
appearActive: 'ConversationItem-right-enter-active',
exit: 'ConversationItem-left-exit',
exitActive: 'ConversationItem-left-exit-active'
}}
timeout={250}
appear={true}
in={this.state.entered} // entered default is true
onEntered={() => console.log('entered')}
onExited={() => console.log('exited')}
>
<ConversationItem
onClick={() => this.setState(entered: false)}
key={item.id}>
</ConversationItem>
</CSSTransition>
))}
</TransitionGroup>
)
动画,因此默认情况下我将ConversationItem-right-enter
设置为true(in
),这很好。但是,当我单击项目时,我将输入设置为false,但是不会调用onExit函数。当我删除TransitionGroup时,仅在其他情况下使用CSSTransition,才会调用onExit方法。