acdlite / acdlite/react-rx-component
Ref as an observable
Đang mở
- Ngôn ngữ chính
- JavaScript
- Star
- 83
- Fork
- 4
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
This came up today trying to pass a `funcSubject` as a ref callback function. Because we're not actually subscribed when the ref callback fires (ie before `componentDidMount`), the value is just kind of lost.
Using a BehaviorSubject instead fixed the issue, but I thought I'd mention it for anyone else who ran into it.
Also I was wondering why you subscribe in componentDidMount and not the constructor? It seems like it potentially adds some unnecessary work. I imagine it's a "universal" thing but I don't have any experience with that...
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.