-
Notifications
You must be signed in to change notification settings - Fork 139
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
activeIndex 不受控 #71
Comments
感觉反馈,我看下 |
提 pull request 会快速给合并吗? bug 挺着急的,要不只能自己发 npm 包了 |
@infeng 建议增加两个属性, defaultActiveIndex 是组件初始化用的index, activeIndex 作为受控属性 |
可以马上发,你提pr
获取 Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
发件人: qiaojie <[email protected]>
发送时间: Friday, August 16, 2019 12:39:48 PM
收件人: infeng/react-viewer <[email protected]>
抄送: feng zhi hao <[email protected]>; Mention <[email protected]>
主题: Re: [infeng/react-viewer] activeIndex 不受控 (#71)
@infeng<https://github.com/infeng> 建议增加两个属性, defaultActiveIndex 是组件初始化用的index, activeIndex 作为受控属性
―
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#71?email_source=notifications&email_token=AD5YKGU5GN2R4F2HCJ37ZM3QEYVRJA5CNFSM4IMDV2P2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4NUN7Q#issuecomment-521881342>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AD5YKGVTCK3L3JB5T5Z2MBDQEYVRJANCNFSM4IMDV2PQ>.
|
@infeng
|
看到了,我改一下 |
@infeng 更新了吗? |
准备了,我测试通过就发布 |
Fixed in |
|
componentDidUpdate 生命周期里做,会造成多一次渲染吧,渲染完后, 通过改 activeIndex ,还会造成一次渲染吧。 3.0 重构的时候考虑下 |
3.0 会改为用 Hooks |
通过Props去更改 activeIndex不受控,如果我更改 images 数据, 相应的 activeIndex 也会更新。
The text was updated successfully, but these errors were encountered: