为了账号安全,请及时绑定邮箱和手机立即绑定

Material-UI:以编程方式触发悬停效果

Material-UI:以编程方式触发悬停效果

手掌心 2021-06-10 14:08:46
我正在Material-UI我的应用程序中呈现以下组件:const handleSetActive = _spyOn => {  linkEl.current.focus();};const linkEl = useRef(null);return (    <ListItem      button      component={SmoothScrollLink}      to={cutTo}      spy      smooth      offset={(phone ? -theme.mixins.toolbar.minHeightPhone : -theme.mixins.toolbar.minHeightDesktop) - 20}      duration={500}      onSetActive={handleSetActive}      // className={classNames(spyOn === cutTo && classes.hover)}      ref={linkEl}      {...other}    />)它正在使用react-scroll包,onSetActive只要滚动经过该特定ListItem.我想以最简单的方式使ListItem(来自 Material-UI)在handleSetActive触发时启用其悬停效果。我怎样才能最好地做到这一点?
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 182 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信