-
-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react fc组件下使用 QueueAnim 标签 报警告 #300
Comments
tween-one 是需要 ref 来做 dom 动画的,然而 React.foreardRef 不能解决子组件为三方组件时的使用,所以这个报警暂时没法解决。 |
This was referenced Apr 26, 2020
Closed
你好 这个问题现在解决了吗 |
React.forwardRef 包住组件试试 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
警告:Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
Check the render method of
TweenOne
.代码如下:
<QueueAnim className="team-info employee-tab" ref={ref}> <Menu data={data ? data.tranList : null} loadNewPage={(id: string | number) => { getDataByDepart(id); }} /> {data && data.longList && data.longList.deptList ? data.longList.deptList.map( (itemData: departType, index: number) => { return ( <Department data={itemData} key={"dept" + index} loadNewPage={(id: string | number) => { getDataByDepart(id); }} /> ); } ) : null} </QueueAnim>
Menu和Department同为fc组件,未使用ref
The text was updated successfully, but these errors were encountered: