react-component / tween-one

Animate One React Element
https://tween-one.vercel.app/
MIT License
380 stars 30 forks source link

height transition is not working #88

Closed pig800509 closed 4 years ago

pig800509 commented 4 years ago

參考 ant-motion

      <Table
        rowKey="id"
        columns={columns}
        dataSource={filterTable}
        components={{
          body: {
            wrapper: useCallback((cprops: any) => {
              return (
                <TweenOneGroup
                  component="tbody"
                  leave={[
                    { duration: 250, opacity: 0 },
                    { height: 0, duration: 200, ease: "easeOutQuad" }
                  ]}
                  appear={false}
                  exclusive
                  {...cprops}
                />
              );
            }, [])
          }
        }}
      />

似乎無法顯示出高度的變化, opacity 可正常顯示, ps: 仍然有warning Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

jljsj33 commented 4 years ago
  1. 警告没办法解,,暂时官方也没给出针对三方组件取 dom 的方案。。。
  2. table 如果要做动画,,必须舍掉 table 的特性,将要动画的元素设定 display: block;
pig800509 commented 4 years ago

@jljsj33 thanks

vexii commented 3 years ago

Whats the solution to this?